1
always@(posedge clk)
begin
r00<=r01;
r01<=r02;
r02<=arr[x][y];
//code
end

will this be synthesizable inside a generate block? Also that 'arr' is 2-Dimensional.

EML
  • 9,619
  • 6
  • 46
  • 78
Joe
  • 11
  • 1
  • This depends on the synthesis tool. Many synthesizers create a RAM like structure for this type of array. – sharvil111 Dec 12 '15 at 07:33
  • Yes, why not. It is not a big deal for generated block or always block. The real problem is if arr was a huge, then synthesis tool will create a large register bank to model this, and result in long runtime and sometimes eat up all memory space and blow up. – jclin Dec 17 '15 at 23:28

1 Answers1

0

To elaborate on the comments above, your synthesis tool should infer that this is memory, but depending on your declaration and usage, there are several scenarios.

  1. You'll get unsynthesizeable or errors in your code due to read-during-write and other memory interface errors due to access patterns

  2. Your memory will actually be inferred as registers, which can make your design unsynthesizeable due to size.

  3. Everything will work great.

Lots of tools (such as Quartus) come with built in functionality for adding memories to your code (i.e. the Megafunction tool).

Tim P
  • 415
  • 3
  • 11