Syntax Question involving parameters, function, ranges... 
Author Message
 Syntax Question involving parameters, function, ranges...

Hi:
Need Help
Trying to write a parameter slice (INIT) to  a memory location.
Getting Error : Range must be bounded by constant expression
Can anyone point out the mistake or the correct way to do it.
------------snippet-------------------------------
//call a memory write function with address and data
parameter INIT = 8'h00000000;
integer count;
initial begin
for (count=0;count<2;count=count +1) begin
$external_memory_write_pli_call(count,INIT[count*4+3 :
count]);//(address,data)<=ERROR
end
end
---------------end-------------------------------

Thanks in Advance
Milan

  milan.saini.vcf
< 1K Download


Tue, 23 Mar 2004 07:36:23 GMT  
 Syntax Question involving parameters, function, ranges...
Hi Milan,

Unfortunately variable width slices are not supported by Verilog or Vhdl.
I think you have to unroll the for loop by hand.

Regards
AC

Quote:

> Hi:
> Need Help
> Trying to write a parameter slice (INIT) to  a memory location.
> Getting Error : Range must be bounded by constant expression
> Can anyone point out the mistake or the correct way to do it.
> ------------snippet-------------------------------
> //call a memory write function with address and data
> parameter INIT = 8'h00000000;
> integer count;
> initial begin
> for (count=0;count<2;count=count +1) begin
> $external_memory_write_pli_call(count,INIT[count*4+3 :
> count]);//(address,data)<=ERROR
> end
> end
> ---------------end-------------------------------

> Thanks in Advance
> Milan

> --



Tue, 23 Mar 2004 17:14:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Fortran syntax question (involving **)

2. parameter syntax for array parameter

3. string function range questions

4. CW4 - Ranges question - changing range values while running

5. OS/2 Question: How can I pass parameters from REXX to DLL function

6. NASM - Question about passing parameters to a function

7. Beginner's question (array parameters to functions)

8. Intrinsic function in PARAMETER question

9. function parameter: question about scope

10. Calling Windows API functions involving windows?

11. Calling through function pointer--syntax question

12. CVF, Absoft bug involving ELEMENTAL character functions

 

 
Powered by phpBB® Forum Software