Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - C-Systemc-VHDL problem in Modelsim

 
Thread Tools Search this Thread
Old 01-24-2007, 04:04 PM   #1
Default C-Systemc-VHDL problem in Modelsim


Hi,

I have the following problem:
I want to verify my RTL code (written in VHDL) with the golden
reference (written in C). The connection between the two model is the
SystemC (Wrapper), the simulator is the Modelsim.
I want to observe a HDL signal, the type is an enumerated one.

VHDL code fragment:
type rxaagc_states is (INIT, WAITFORINITSD, WAITFORSD_ACT, AAGC_SP,
AAGC_COARSE, AAGC_EXTENDED, AAGC_FINE,
HBW_COUNTDOWN, RECEPTION, TRANSMIT, DUMMY1,
DUMMY2, DUMMY3, DUMMY4, DUMMY5, DUMMY6);
....
signal d_state, q_state : rxaagc_states;
....

First I tried

SystemC code fragment:
....
sc_signal< sc_lv<4> > observed_state; //16 states -> 4 bits ?!?
....
observed_state.observe_foreign_signal(path...)

Modelsim said: width mismatch between HDL SystemC signals

OK, the error message said that the bitwitdh of the HDL signal is 1(?).
Correction in the code...

Error!

I have defined an enum for the states in the SystemC wrapper with the
same states...

Error!

Please help!

Have a nice day, Peter!



Mr. Peterfolk
  Reply With Quote
Old 01-24-2007, 06:41 PM   #2
NigelE
 
Posts: n/a
Default Re: C-Systemc-VHDL problem in Modelsim


On Jan 24, 4:04 pm, "Mr. Peterfolk" <peter.sz.kov...@gmail.com> wrote:
> Hi,
>
> I have the following problem:
> I want to verify my RTL code (written in VHDL) with the golden
> reference (written in C). The connection between the two model is the
> SystemC (Wrapper), the simulator is the Modelsim.
> I want to observe a HDL signal, the type is an enumerated one.
>
> VHDL code fragment:
> type rxaagc_states is (INIT, WAITFORINITSD, WAITFORSD_ACT, AAGC_SP,
> AAGC_COARSE, AAGC_EXTENDED, AAGC_FINE,
> HBW_COUNTDOWN, RECEPTION, TRANSMIT, DUMMY1,
> DUMMY2, DUMMY3, DUMMY4, DUMMY5, DUMMY6);
> ...
> signal d_state, q_state : rxaagc_states;
> ...
>
> First I tried
>
> SystemC code fragment:
> ...
> sc_signal< sc_lv<4> > observed_state; //16 states -> 4 bits ?!?
> ...
> observed_state.observe_foreign_signal(path...)
>
> Modelsim said: width mismatch between HDL SystemC signals
>
> OK, the error message said that the bitwitdh of the HDL signal is 1(?).
> Correction in the code...
>
> Error!
>
> I have defined an enum for the states in the SystemC wrapper with the
> same states...
>
> Error!
>
> Please help!
>
> Have a nice day, Peter!


Hello Peter

Only bit, std_logic & std_ulogic types (+ vector versions) are
supported across the SystemC/VHDL language interface.
(Have a look in the Mixed Language Simulation section of the User
Manual for full details)

Thus, you'll need some extra VHDL code to convert the enumeration into
a supported type.

Hope this helps

regards

- Nigel



NigelE
  Reply With Quote
Old 01-24-2007, 06:45 PM   #3
HT-Lab
 
Posts: n/a
Default Re: C-Systemc-VHDL problem in Modelsim

"Mr. Peterfolk" <> wrote in message
news: ups.com...
> Hi,
>
> I have the following problem:
> I want to verify my RTL code (written in VHDL) with the golden
> reference (written in C). The connection between the two model is the
> SystemC (Wrapper), the simulator is the Modelsim.
> I want to observe a HDL signal, the type is an enumerated one.
>
> VHDL code fragment:
> type rxaagc_states is (INIT, WAITFORINITSD, WAITFORSD_ACT, AAGC_SP,
> AAGC_COARSE, AAGC_EXTENDED, AAGC_FINE,
> HBW_COUNTDOWN, RECEPTION, TRANSMIT, DUMMY1,
> DUMMY2, DUMMY3, DUMMY4, DUMMY5, DUMMY6);
> ...
> signal d_state, q_state : rxaagc_states;
> ...
>
> First I tried
>
> SystemC code fragment:
> ...
> sc_signal< sc_lv<4> > observed_state; //16 states -> 4 bits ?!?
> ...
> observed_state.observe_foreign_signal(path...)
>
> Modelsim said: width mismatch between HDL SystemC signals
>
> OK, the error message said that the bitwitdh of the HDL signal is 1(?).
> Correction in the code...
>
> Error!
>
> I have defined an enum for the states in the SystemC wrapper with the
> same states...
>
> Error!
>
> Please help!


I don't believe you can do this, although the 6.2f User Guide is not 100%
clear on this, it does state that enum is not supported on language
boundaries. I guess you can always do it the Verilog95 way and give each
state a separate value

I would log this with Mentor as an enhancement request assuming of course it
is not supported.

Hans
www.ht-lab.com


>
> Have a nice day, Peter!
>





HT-Lab
  Reply With Quote
Old 01-25-2007, 06:53 AM   #4
Mr. Peterfolk
 
Posts: n/a
Default Re: C-Systemc-VHDL problem in Modelsim

HT-Lab írta:
> "Mr. Peterfolk" <> wrote in message
> news: ups.com...
> > Hi,
> >
> > I have the following problem:
> > I want to verify my RTL code (written in VHDL) with the golden
> > reference (written in C). The connection between the two model is the
> > SystemC (Wrapper), the simulator is the Modelsim.
> > I want to observe a HDL signal, the type is an enumerated one.
> >
> > VHDL code fragment:
> > type rxaagc_states is (INIT, WAITFORINITSD, WAITFORSD_ACT, AAGC_SP,
> > AAGC_COARSE, AAGC_EXTENDED, AAGC_FINE,
> > HBW_COUNTDOWN, RECEPTION, TRANSMIT, DUMMY1,
> > DUMMY2, DUMMY3, DUMMY4, DUMMY5, DUMMY6);
> > ...
> > signal d_state, q_state : rxaagc_states;
> > ...
> >
> > First I tried
> >
> > SystemC code fragment:
> > ...
> > sc_signal< sc_lv<4> > observed_state; //16 states -> 4 bits ?!?
> > ...
> > observed_state.observe_foreign_signal(path...)
> >
> > Modelsim said: width mismatch between HDL SystemC signals
> >
> > OK, the error message said that the bitwitdh of the HDL signal is 1(?).
> > Correction in the code...
> >
> > Error!
> >
> > I have defined an enum for the states in the SystemC wrapper with the
> > same states...
> >
> > Error!
> >
> > Please help!

>
> I don't believe you can do this, although the 6.2f User Guide is not 100%
> clear on this, it does state that enum is not supported on language
> boundaries. I guess you can always do it the Verilog95 way and give each
> state a separate value
>
> I would log this with Mentor as an enhancement request assuming of course it
> is not supported.
>
> Hans
> www.ht-lab.com
>
>
> >
> > Have a nice day, Peter!
> >


OK ! I wont waste my time to solve this!

Thanks!



Mr. Peterfolk
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL problem with variables krkrkr Hardware 0 10-16-2009 07:36 PM
vhdl std_logic_vector slice access problem topi1234 Software 0 04-18-2008 12:07 PM
VHDL problem - Signal counter cannot be synthesized, bad synchronous description. shipacpoloy Software 0 08-14-2007 07:26 AM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46