SystemC std_logic resolved type

Discussion in 'VHDL' started by zoro, Jul 3, 2003.

  1. zoro

    zoro Guest

    Hi,
    I have encountred a problem while working with resolved sc_logic type.
    Considering using resolved sc_logic even for signals, when I assign a
    new value to such signals their value change to 'X'.

    for example in the following code, "sa" signal gets 'X' at 25 ns
    instead of '1'; This case doesn't happen for a,b,c signals.

    -------Header
    SC_MODULE (testbench) {

    sc_signal_rv<8> a;
    sc_signal_rv<8> b;
    sc_signal_rv<8> c;
    sc_signal_resolved sa;
    sc_signal_resolved sb;
    sc_signal_resolved sc;

    sc_signal_rv<8> z;

    void p1 ();
    ....
    SC_CTOR(testbench) {

    sa = (sc_logic )'0';
    SC_THREAD(p1);

    SC_THREAD(p2);
    ....
    };
    #endif
    ---------CPP
    void testbench::p1(){
    while(true){
    sa = (sc_logic )'0';
    wait(25,SC_NS);
    sa = (sc_logic )'1';
    wait(25,SC_NS);
    }
    }
    zoro, Jul 3, 2003
    #1
    1. Advertising

  2. zoro

    Alan Fitch Guest

    "zoro" <> wrote in message
    news:...
    > Hi,
    > I have encountred a problem while working with resolved

    sc_logic type.
    > Considering using resolved sc_logic even for signals, when

    I assign a
    > new value to such signals their value change to 'X'.
    >
    > for example in the following code, "sa" signal gets 'X' at

    25 ns
    > instead of '1'; This case doesn't happen for a,b,c

    signals.
    >
    > -------Header
    > SC_MODULE (testbench) {
    >
    > sc_signal_rv<8> a;
    > sc_signal_rv<8> b;
    > sc_signal_rv<8> c;
    > sc_signal_resolved sa;
    > sc_signal_resolved sb;
    > sc_signal_resolved sc;
    >
    > sc_signal_rv<8> z;
    >
    > void p1 ();
    > ...
    > SC_CTOR(testbench) {
    >
    > sa = (sc_logic )'0';
    > SC_THREAD(p1);
    >
    > SC_THREAD(p2);
    > ...
    > };
    > #endif
    > ---------CPP
    > void testbench::p1(){
    > while(true){
    > sa = (sc_logic )'0';
    > wait(25,SC_NS);
    > sa = (sc_logic )'1';
    > wait(25,SC_NS);
    > }
    > }


    I don't think we can answer that question without
    knowing what happens in process p2().

    I suggest you post the complete code to the "SystemC Help"
    web forum at www.systemc.org,

    kind regards

    Alan


    --
    Alan Fitch
    Consultant

    DOULOS - Developing Design Know-how
    VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification *
    Project Services

    Doulos Ltd. Church Hatch, 22 Market Place, Ringwood,
    Hampshire, BH24 1AW, UK
    Tel: +44 (0)1425 471223 mail:

    Fax: +44 (0)1425 471573 Web:
    http://www.doulos.com

    The contents of this message may contain personal views
    which are not the
    views of Doulos Ltd., unless specifically stated.
    Alan Fitch, Jul 3, 2003
    #2
    1. Advertising

  3. The problem might be that you should typecast 1 in stead of '1'.

    /Nicolai

    zoro wrote:
    > Hi,
    > I have encountred a problem while working with resolved sc_logic type.
    > Considering using resolved sc_logic even for signals, when I assign a
    > new value to such signals their value change to 'X'.
    >
    > for example in the following code, "sa" signal gets 'X' at 25 ns
    > instead of '1'; This case doesn't happen for a,b,c signals.
    >
    > -------Header
    > SC_MODULE (testbench) {
    >
    > sc_signal_rv<8> a;
    > sc_signal_rv<8> b;
    > sc_signal_rv<8> c;
    > sc_signal_resolved sa;
    > sc_signal_resolved sb;
    > sc_signal_resolved sc;
    >
    > sc_signal_rv<8> z;
    >
    > void p1 ();
    > ...
    > SC_CTOR(testbench) {
    >
    > sa = (sc_logic )'0';
    > SC_THREAD(p1);
    >
    > SC_THREAD(p2);
    > ...
    > };
    > #endif
    > ---------CPP
    > void testbench::p1(){
    > while(true){
    > sa = (sc_logic )'0';
    > wait(25,SC_NS);
    > sa = (sc_logic )'1';
    > wait(25,SC_NS);
    > }
    > }
    =?ISO-8859-1?Q?Nicolai_J=F8rgensen?=, Jul 5, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bossanovaplayer
    Replies:
    4
    Views:
    12,530
    bossanovaplayer
    Jun 17, 2005
  2. alessio
    Replies:
    1
    Views:
    806
  3. freeflytim
    Replies:
    4
    Views:
    412
    Meteor
    May 16, 2007
  4. dushkin
    Replies:
    5
    Views:
    7,159
  5. sylwa
    Replies:
    2
    Views:
    1,273
    sylwa
    Apr 21, 2011
Loading...

Share This Page