Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Verilog/SV: Using an array as a set of individual registers and not RAM

pbernardi

Full Member level 2
Joined
Nov 21, 2013
Messages
132
Helped
27
Reputation
54
Reaction score
27
Trophy points
1,308
Activity points
2,348
Hello,
I would like to have a parameterizable array (let us say, for N in range of 32 to 128 elements), with a high number of parallel R/W access (up to 8 accesses, also parameterizable).

So, when I define the register:

Code:
reg [REGSIZE-1:0] g [0:N-1];

it try to infers a distributed RAM, which is not good because 8x parallel accesses to a distributed RAM generate a huge logic. I need the synthesis tool to generate an array of N single registers instead of a distributed RAM. Is this possible?

Alternatively, is it possible to use a generate or other king of loop/parallel processing to a) generate and b) access a set of N individual registers?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
50,032
Helped
14,496
Reputation
29,262
Reaction score
13,430
Trophy points
1,393
Location
Bochum, Germany
Activity points
287,139
So, when I define the register:

Code:
reg [REGSIZE-1:0] g [0:N-1];
it try to infers a distributed RAM
I don't believe so. In case of doubt, a synthesis tool will implement the solution with smallest overall resource utilisation. If you prefer a specific implementation, it can be enforced by synthesis attributes (if the implementation is feasible).
 

pbernardi

Full Member level 2
Joined
Nov 21, 2013
Messages
132
Helped
27
Reputation
54
Reaction score
27
Trophy points
1,308
Activity points
2,348
Thanks FvM.
The distributed RAM really does not appear in the synthesis report. I will double check why I have that extra amount of logic, must be something else related.
 

ILIA KALISTRU

Newbie level 4
Joined
Feb 13, 2022
Messages
7
Helped
0
Reputation
0
Reaction score
3
Trophy points
3
Activity points
68
You can generate multiport memory with generate loop, but it will be implemented with registers (FFs). Might work for small memories, but it becomes impractical with any significant amount of memory configured.

For muliport memory of significant sizes you need a much more complicated design. Here a list of some multi-port designs: http://fpgacpu.ca/multiport/
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top