Shilpa-_-Singh
Newbie level 2
- Joined
- Dec 5, 2014
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 13
Hello sir,
I am a newbie to system verilog and I was trying to run the following code given in spears book
But due to some unfortunate reason it throws errors like "expecting class","unexpected initial"
Can someone please help me in making this code runnable in modelsim? and tell me what should be the output.
Thankyou
I am a newbie to system verilog and I was trying to run the following code given in spears book
Code:
function void init(ref int f[5], input int start);
foreach (f[i])
f[i] = i + start;
endfunction
int fa[5];
initial begin
init(fa, 5);
foreach (fa[i])
$display("fa[%0d] = %0d", i, fa[i]);
end
But due to some unfortunate reason it throws errors like "expecting class","unexpected initial"
Can someone please help me in making this code runnable in modelsim? and tell me what should be the output.
Thankyou