Objectmix
Tags Register Mark Forums Read

Verilog 2001 Multidemensional arrays with real : verilog

This is a discussion on Verilog 2001 Multidemensional arrays with real within the verilog forums in Programming Languages category; Dear Experts outside, I'm starting with verilog 2001 and coded this: real edges [0:2][0:3]; edges = { { 0 , 0.5 ,0 , 3 } , //AT0 { 0 , 0.2 ,0 , 3 } , //SW3 { 0 , 0.1 ,0 , 3 } //SW2 }; What I would like to achive is a two dimensional array of real values. The compiler complaines at 0.5 in line 3 of the code listed here. I'm using ncverilog: 06.20-p001 with tells me: edges = { | ncvlog: *E,EXPLPA (_uif/Stimulus.v,8|6): expecting a left parenthesis ('(') [12.1.2][7.1(IEEE)]. (`include file: _uif/Stimulus.v line 8, file: ...


Object Mix > Programming Languages > verilog > Verilog 2001 Multidemensional arrays with real

Reply

 

LinkBack Thread Tools
  #1  
Old 12-08-2007, 11:46 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Verilog 2001 Multidemensional arrays with real

Dear Experts outside,

I'm starting with verilog 2001 and coded this:


real edges [0:2][0:3];
edges = {
{ 0 , 0.5 ,0 , 3 } , //AT0
{ 0 , 0.2 ,0 , 3 } , //SW3
{ 0 , 0.1 ,0 , 3 } //SW2
};

What I would like to achive is a two dimensional array of real values.

The compiler complaines at 0.5 in line 3 of the code listed here.

I'm using ncverilog: 06.20-p001 with tells me:
edges = {
|
ncvlog: *E,EXPLPA (_uif/Stimulus.v,8|6): expecting a left parenthesis
('(') [12.1.2][7.1(IEEE)].
(`include file: _uif/Stimulus.v line 8, file: tb.v line 6)
{ 0 , 0.5 ,0 , 3 } , //AT0
|


Does anyone know how to make ith right ??

Thanks

Rolf
Reply With Quote
  #2  
Old 12-09-2007, 12:52 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Verilog 2001 Multidemensional arrays with real

On Sat, 8 Dec 2007 08:46:49 -0800 (PST), RolfK
<Rolf.Kemper@eu.necel.com> wrote:

>Dear Experts outside,
>
>I'm starting with verilog 2001 and coded this:


Are you using +v2k on your command line?
Reply With Quote
  #3  
Old 12-09-2007, 02:03 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Verilog 2001 Multidemensional arrays with real

On 9 Dez., 18:52, mk <kal*@dspia.*comdelete> wrote:
> On Sat, 8 Dec 2007 08:46:49 -0800 (PST), RolfK
>
> <Rolf.Kem...@eu.necel.com> wrote:
> >Dear Experts outside,

>
> >I'm starting with verilog 2001 and coded this:

>
> Are you using +v2k on your command line?


No, I understood that NC-Verilog will understand it anyhow.
Meantime I know that the declaration is OK ,
but the assignment not. As I have written a code generator I assigned
the values one by one in an initila routine.
Not nice, but works.

Rolf
Reply With Quote
  #4  
Old 12-10-2007, 03:37 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Verilog 2001 Multidemensional arrays with real

RolfK wrote:
> On 9 Dez., 18:52, mk <kal*@dspia.*comdelete> wrote:
>> On Sat, 8 Dec 2007 08:46:49 -0800 (PST), RolfK
>>
>> <Rolf.Kem...@eu.necel.com> wrote:
>>> Dear Experts outside,
>>> I'm starting with verilog 2001 and coded this:

>> Are you using +v2k on your command line?

>
> No, I understood that NC-Verilog will understand it anyhow.
> Meantime I know that the declaration is OK ,
> but the assignment not. As I have written a code generator I assigned
> the values one by one in an initila routine.
> Not nice, but works.
>
> Rolf


I wasn't even aware that one could have an array of reals, but it seems
to work in Modelsim. But, like you say, you have to initialize it one
value at a time with an initial construct. You might also be able to
use $fscanf to read real values from a text file and initialize the
array. -Kevin
Reply With Quote
  #5  
Old 12-11-2007, 09:52 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Verilog 2001 Multidemensional arrays with real

On Dec 9, 2:03 pm, RolfK <Rolf.Kem...@eu.necel.com> wrote:
> On 9 Dez., 18:52, mk <kal*@dspia.*comdelete> wrote:
>
> > Are you using +v2k on your command line?

>
> No, I understood that NC-Verilog will understand it anyhow.


That is correct. NC-Verilog assumes Verilog-2001 by default.

> Meantime I know that the declaration is OK ,
> but the assignment not.


Verilog does not have the concept of an array initializer like C
(though SystemVerilog does).


Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
Real-time stimulus to a verilog DUT usenet verilog 2 10-01-2007 04:13 PM
Xilinx XST 9.1, Verilog 2-D arrays, always @* usenet verilog 9 03-19-2007 11:17 AM
Bit-width of arithmetic expressions in Verilog-2001? broken example usenet verilog 6 03-15-2007 09:16 AM
verilog multidimentional arrays usenet verilog 2 05-08-2006 12:01 PM
Verilog 2001 File I/O: read large file? usenet verilog 15 04-06-2006 09:03 PM


All times are GMT -5. The time now is 08:46 AM.