M
Mark Brehob
Guest
Hello,
I have a student who is trying to use arrays of buses, something we
normally recommend against.
He asks:
====================================================
We want to initialize an array of registers to some value during
reset. However, it's not working out. Here is what I have:
<code>
reg [6:0] i;
reg [63:0] foo[63:0];
reg [63:0] bar;
always @(posedge clock)
begin
if (reset)
begin
for(i=0; i<64; i=i+1)
begin
foo <= `SD 64'hdeadbeefbaadbeef; //Initialize to bogus
value
bar <= `SD 0; //Initialize to zero
end
end
end
</code>
So when I look at the waveform in make int, bar would be initialized
to all 0's, however, foo gets "NA". I think I'm not doing the array
indexing right. I want each of the 64 foo's to get the bogus value.
Any help would be awesome.
=======================================
we are using fairly new versions/updates of vcs and design compiler.
He's having problems even outside of synthesis, which seems odd. Any
thoughts/ideas? What are we missing here?
We've got it working _other_ than reset fairly well. Just this reset
thing is causing problems.
Thanks very much,
Mark
I have a student who is trying to use arrays of buses, something we
normally recommend against.
He asks:
====================================================
We want to initialize an array of registers to some value during
reset. However, it's not working out. Here is what I have:
<code>
reg [6:0] i;
reg [63:0] foo[63:0];
reg [63:0] bar;
always @(posedge clock)
begin
if (reset)
begin
for(i=0; i<64; i=i+1)
begin
foo <= `SD 64'hdeadbeefbaadbeef; //Initialize to bogus
value
bar <= `SD 0; //Initialize to zero
end
end
end
</code>
So when I look at the waveform in make int, bar would be initialized
to all 0's, however, foo gets "NA". I think I'm not doing the array
indexing right. I want each of the 64 foo's to get the bogus value.
Any help would be awesome.
=======================================
we are using fairly new versions/updates of vcs and design compiler.
He's having problems even outside of synthesis, which seems odd. Any
thoughts/ideas? What are we missing here?
We've got it working _other_ than reset fairly well. Just this reset
thing is causing problems.
Thanks very much,
Mark