M
Murph
Guest
Hello!
I'm trying to implement a game in VHDL, for simulation on a Spartan-3
board (through Xilinx WebPack if it matters).
I need to have a 200-bit array to store the current "state" of the game
board (marking each location as either taken or not), and I need to
store a four-element array of locations on that board that represent
the "current piece" (which isn't accounted for in the 200 bits).
Would this work?
subtype boardSize is integer range 0 to 199;
type boardArray is array (natural range <> of bit;
type boardLocation is array (natural range <> of boardSize;
signal boardState : boardArray(boardSize);
signal pieceLocations : boardLocation(0 to 3);
Or do you have any better idea / advice?
Thanks,
--Murph
PS - Would I be able to address something like
boardArray(boardLocation("1"))? that'd be awesome.
I'm trying to implement a game in VHDL, for simulation on a Spartan-3
board (through Xilinx WebPack if it matters).
I need to have a 200-bit array to store the current "state" of the game
board (marking each location as either taken or not), and I need to
store a four-element array of locations on that board that represent
the "current piece" (which isn't accounted for in the 200 bits).
Would this work?
subtype boardSize is integer range 0 to 199;
type boardArray is array (natural range <> of bit;
type boardLocation is array (natural range <> of boardSize;
signal boardState : boardArray(boardSize);
signal pieceLocations : boardLocation(0 to 3);
Or do you have any better idea / advice?
Thanks,
--Murph
PS - Would I be able to address something like
boardArray(boardLocation("1"))? that'd be awesome.