- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i faced a problem neither to use constant nor variable.
If i use integer then there will be a error([ocount_as and ocount_s are not constant) on this code:out_reg[i] = out_pin_in[ocount_ascount_s];
if i use the parameter then there will be a error (value must not be assigned to nonvariable "icount_e"
Can anyone tell me that what kind of data types should be declared?
Thanks
Pieces of the code as below:
integer icount_s, icount_e, icount_as;
always @ (reset or trans or out_pin_in or out_reg)
begin
ocount_s = 0;
ocount_e = n;
ocount_as = 7;
if (reset)
begin
for (i=0; i<8; i =i+1)
out_reg[i] = 0;
end
else if (trans)
begin
for (i=0; i<8; i= i+1)
if (ocount_e >= 8)
begin
out_reg[i] = out_pin_in[ocount_ascount_s];
ocount_e = ocount_e - 8;
ocount_s = ocount_s +8;
ocount_as = ocount_as + 8;
end
else if (ocount_e ==0)
out_reg[i] = 0;
else
begin
for (j=0; j<8; j= j+1)
if (ocount_e> 0)
begin
out_reg[i][j] = out_pin_in[n-ocount_e];
ocount_e = ocount_e -1;
end
else
begin
out_reg[i][j] =0;
end
ocount_e =0;
end
end
else
for (i=0; i <8; i=i+1)
begin
out_reg[i] = out_reg[i];
end
end
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
correction: :( is :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i faced a problem neither to use constant nor variable.
If i use integer then there will be a error([ocount_as and ocount_s are not constant) on this code:out_reg[i] = out_pin_in[ocount_ashttp://www.alteraforum.com/images/smilies/redface.gif count_s]; if i use the parameter then there will be a error (value must not be assigned to nonvariable "icount_e" Can anyone tell me that what kind of data types should be declared? Thanks Pieces of the code is attached:- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page