Line 30... |
Line 30... |
|
|
|
|
package powerGrid is
|
package powerGrid is
|
|
|
-- R2 for size and width
|
-- R2 for size and width
|
type SIZE_WIDTH is array (0 to 1) of integer;
|
type SIZE_WIDTH is array (integer,integer) of integer;
|
type DUPLA is array (0 to 2) of SIZE_WIDTH;
|
type DUPLA is array (0 to 2,1 downto 0) of integer;
|
|
|
-- Tuple for widths
|
-- Tuple for widths
|
type WARRAY is array (0 to 2) of integer;
|
type WARRAY is array (0 to 2) of integer;
|
|
|
-- Index
|
-- Index
|
constant SZINDEX: integer :=0;
|
constant SZINDEX: integer :=0; -- Size Description Index.
|
constant WDINDEX: integer :=1;
|
constant WDINDEX: integer :=1; -- Width description Index.
|
|
|
-- Register file for spheres.
|
-- Register file for spheres.
|
-- OP1 : One sphere output per clock.
|
-- OP1 : One sphere output per clock.
|
-- OP2 : Two sphere output per clock.
|
-- OP2 : Two sphere output per clock.
|
-- OP4 : Four sphere output per clock.
|
-- OP4 : Four sphere output per clock.
|
Line 51... |
Line 51... |
constant OP1 : integer := 0;
|
constant OP1 : integer := 0;
|
|
|
constant SZALFA : integer := 1;
|
constant SZALFA : integer := 1;
|
constant SZBETA : integer := 2;
|
constant SZBETA : integer := 2;
|
|
|
|
constant DBUSW : integer := 64;
|
constant BUSW : integer := 32;
|
constant BUSW : integer := 32;
|
constant HBUSW : integer := 18;
|
constant HBUSW : integer := 18;
|
|
|
-- Size and Width.
|
-- Size and Width depending upon the number of spheres to push out in one clock (OP1= One sphere, OP2 = Two spheres, OP4= Four spheres).
|
constant REGSZADD : WARRAY := (12,11,10);
|
constant REGSZADD : WARRAY := (12,11,10);
|
constant CIDSZADD : DUPLA := ((1,0),(2,1),(4,2));
|
constant CIDSZADD : DUPLA := ((1,0),(2,1),(4,2));
|
|
|
|
|
|
|
Line 298... |
Line 299... |
-- Sphere Register Block
|
-- Sphere Register Block
|
component sphereRegisterBlock
|
component sphereRegisterBlock
|
generic (
|
generic (
|
|
|
OPMODE : integer := OP4; -- By default push out 4 spheres at same time.
|
OPMODE : integer := OP4; -- By default push out 4 spheres at same time.
|
SZMODE : integer := SZBETA; -- By default the max sphere numbers is 2048, but could be 4096 with SZALFA.
|
SZMODE : integer := SZBETA -- By default the max sphere numbers is 2048, but could be 4096 with SZALFA.
|
|
|
|
|
);
|
);
|
port (
|
port (
|
|
|
|
|
clk, ena: in std_logic; -- The usual control signals.
|
clk, ena: in std_logic; -- The usual control signals.
|
|
|
wen : in std_logic_vector (CIDSZADD(OPMODE(SZINDEX))*4-1 downto 0); -- Write enable signals
|
wen : in std_logic_vector (CIDSZADD(OP4,SZINDEX)-1 downto 0); -- Write enable signals
|
add : in std_logic_vector (REGSZADD(OPMODE)-SZMODE downto 0); -- Address bus
|
add : in std_logic_vector (REGSZADD(OPMODE)-SZMODE downto 0); -- Address bus
|
|
|
datain : in std_logic_vector (BUSW-1 downto 0); -- incoming data from 32 bits width bus.
|
datain : in std_logic_vector (BUSW-1 downto 0); -- incoming data from 32 bits width bus.
|
|
|
Vx : out std_logic_vector (OPMODE*HBUSW-1 downto 0); -- outcoming data to 54 bit width bus multiplexer selector and intersection test cube.
|
Vx : out std_logic_vector (OPMODE*HBUSW-1 downto 0); -- outcoming data to 54 bit width bus multiplexer selector and intersection test cube.
|
Line 318... |
Line 320... |
Vz : out std_logic_vector (OPMODE*HBUSW-1 downto 0); -- outcoming data to 54 bit width bus multiplexer selector and intersection test cube.
|
Vz : out std_logic_vector (OPMODE*HBUSW-1 downto 0); -- outcoming data to 54 bit width bus multiplexer selector and intersection test cube.
|
K : out std_logic_vector (OPMODE*BUSW-1 downto 0)
|
K : out std_logic_vector (OPMODE*BUSW-1 downto 0)
|
|
|
);
|
);
|
|
|
end entity;
|
end component;
|
|
|
-- A scan flip flop, aka selectable input ff.
|
-- A scan flip flop, aka selectable input ff.
|
component scanFF
|
component scanFF
|
generic (
|
generic (
|
W : integer := 8);
|
W : integer := 8);
|