Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - Re: [systemc-forum] Hi need help regarding executing process and methods Message Thread: Previous | Next
  • To: Sumit Adhikari <adhikari@xxxxxxxxxxxxxxxx>
  • From: Rama krishna Reddy <krisreddi46@xxxxxxxxx>
  • Date: Sat, 11 Feb 2012 02:44:43 +0100
  • Cc: "systemc-forum@xxxxxxxxxxxxxxxxxxx" <systemc-forum@xxxxxxxxxxxxxxxxxxx>
Send Email to systemc-forum@lists.accellera.org:
Send new message
Reply to this message
Hello sorry for not mentioning test case. Below is the header and classes which i used. Now when i run all methods are executed concurrently, but i need result as method_a,method_b,method_c,method_a,method_b,method_c......continues till simulation time finishes. 
suppose module_a duration is 20 us, module_b duration is 200 us and module_c duration is 40 us and total simulation time is 1 ms.

Thank you.

//module_a.h
SC_MODULE (module_a)
{
    sc_event event_a;
    
    SC_CTOR(module_a)
    {
        SC_THREAD(thread_a);
        SC_METHOD(method_a);
        sensitive<<event_a;
        dont_initialize();
    }
    
    void thread_a(void);
    void method_a(void);
};

//module_b.h
SC_MODULE (module_b)
{
    sc_in<bool> clk;
        
    SC_CTOR(module_b)
    {
        SC_METHOD(method_b);
        sensitive<<clk.pos();
        dont_initialize();
    }
    
    void method_b(void);
};

//module_c.h
SC_MODULE (module_c)
{
    sc_event event_c;
    
    SC_CTOR(module_c)
    {
        SC_THREAD(thread_c);
        SC_METHOD(method_c);
        sensitive<<event_c;
        dont_initialize();
    }
    
    void thread_c(void);
    void method_c(void);
};

//module_a.cpp
void module_a::method_a(void)
{
    cout<<"method_a : "<<sc_time_stamp()<<endl;
}
void module_a::thread_a(void)
{
    for(;;)
    {
        wait(200,SC_US);
        event_a.notify();
    }
}


//module_b.cpp
void module_b::method_b(void)
{
    cout<<"method_b : "<<sc_time_stamp()<<endl;
}

//module_c.cpp
void module_c::method_c(void)
{
    cout<<"method_c : "<<sc_time_stamp()<<endl;
}
void module_c::thread_c(void)
{
    for(;;)
    {
        wait(200,SC_US);
        event_c.notify();
    }
}

//main.cpp
int sc_main(int argc, char* argv[])
{
    sc_clock clk("clk",30,SC_US);
    
    module_a imodule_a("imodule_a");
    module_b imodule_b("imodule_b");
    module_c imodule_c("imodule_c");
    
    imodule_b.clk(clk);
    
    sc_start(1,SC_MS);
    return 0;
}


On Thu, Feb 9, 2012 at 11:33 PM, Sumit Adhikari <adhikari@xxxxxxxxxxxxxxxx> wrote:
Rama :

Reporting a problem without a test case will not help.

Can you please send us a minimal test case of your issue ?

Regards,

-------
Sumit Adhikari,
Institute of Computer Technology,
Vienna University of Technology,
Gußhausstraße 27-29,1040 Vienna
________________________________________
From: systemc-forum@xxxxxxxxxxxxxxxxxxx [systemc-forum@xxxxxxxxxxxxxxxxxxx] on behalf of Rama krishna Reddy [krisreddi46@xxxxxxxxx]
Sent: Thursday, February 09, 2012 11:06 PM
To: systemc-forum@xxxxxxxxxxxxxxxxxxx
Subject: [systemc-forum] Hi need help regarding executing process and methods sequentially rather then concurrently.

Hello Friends,

I am modelling an FSM related to some communication cycle. Each cycle has
some duration and this cycles are repeated for a particular simulation time.
Each cycle is divided into 3 parts static, dynamic and idle. The static and idle
duration is fixed dynamic changes depending on number of slots it has. I
implemented each of them in separate header files and source respectively; and
if i start the simulation they are executed in concurrently. But i need to
execute in sequential way as static,dynamic,idle and this should carry on till
simulation time finishes.



Thanks you.


By Date: Previous | Next Current Thread By Thread: Previous | Next