Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

VHDL FF based memory array

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,641
Helped
302
Reputation
606
Reaction score
297
Trophy points
1,363
Activity points
18,257
Hello,

When I have a FF based memory array and I want to bring it's ports to the entity's output - I concatanate all the memory cells to a single long vector of length: memory_depth * memory_width

But is it possible to define the entity I/Os themselves as a 2D array ?
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,036
Helped
2,063
Reputation
4,143
Reaction score
2,013
Trophy points
1,393
Activity points
38,691
Yes. You'll have to declare the type in a package though.
 

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,641
Helped
302
Reputation
606
Reaction score
297
Trophy points
1,363
Activity points
18,257
Please elaborate.

Can you show an example please...
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,036
Helped
2,063
Reputation
4,143
Reaction score
2,013
Trophy points
1,393
Activity points
38,691
Code:
package types_package is 
  type 2d_array_t is array(natural range <>, natural range <>) of integer;
end package;

use work.types_package.all;

entity some_ent is 
  generic(
    MEMORY_DEPTH : natural;
    MEMORY_WIDTH : natural
  );

  port (
    regs : out 2d_array_t(0 to MEMORY_DEPTH-1, 0 to MEMORY_WIDTH-1)
 );
end entity;
 
  • Like
Reactions: shaiko

    shaiko

    points: 2
    Helpful Answer Positive Rating

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,641
Helped
302
Reputation
606
Reaction score
297
Trophy points
1,363
Activity points
18,257
THANKS TrickyDicky !

BTW ;
Does Verilog has this type as a standart ?
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,036
Helped
2,063
Reputation
4,143
Reaction score
2,013
Trophy points
1,393
Activity points
38,691
I dont know a lot about verilog, but afaik standard verilog limits arrays to 2d (its limitless in VHDL). SystemVerilog removes this restriction.
 

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,641
Helped
302
Reputation
606
Reaction score
297
Trophy points
1,363
Activity points
18,257
But only 2D's are synthesizable...yes, I know that.

What I meant is:
Per your explanation I see that an array IO isn't a standart type in VHDL - and requires a type def to work...I asked if array IOs in Verilog are a standart feature of the language?
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top