![]() |
|
|
|||||||
![]() |
VHDL - C-Systemc-VHDL problem in Modelsim |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
"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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |