C-Systemc-VHDL problem in Modelsim

M

Mr. Peterfolk

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!
 
N

NigelE

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
 
H

HT-Lab

Mr. Peterfolk said:
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
 
M

Mr. Peterfolk

HT-Lab írta:
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

OK ! I wont waste my time to solve this!

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top