Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

Advise on Multiple Driver problem

$
0
0

Hi all

 

 

I am trying to build a Statemachinefor different tasks that is given as input:

 

To be more specific, i have different states like Not_ready, ready, running which would do some operations and advance the time respectively

 

 

 

I have something like this:

 

class StateMachine: public sc_module

{

enum state {NotREAdy, ready,..}

 

 

sc_out<bool> out;

 

void perform

{

switch (state)

{

case Not_ready: ... Do something and update state value to "ready"

case Ready : Do something and update state value to "running"

case Rnning : do some calculation and wait for event

out.write(true); // send output to timer module

}

 

//I have a constructor lik this

StateMachine(sc-module_name name, ......): sc_module(name)

{..

 

 

sensitive < Event;

}

 

 

 

};

 

 

 

SC_MODULE(Timer)

{

sc_in<bool> timeIn;

 

void time()

{

Event.notify(20,SC_NS);

}

 

SC_CTOR(Timer)

{

senstivity << TimeIn;

SC_METHOD(time);

}

};

 

 

main()

{

 

// I am creating two instances of StateMAchine for TaskA and taskB

 

 

StateMachine *M1 = new StateMachine(TaskA, .....);

Statemachine*M2 = new Statemachine(Taskb,.......);

 

 

Now when I try to bind the ports, I get error of multple drivers from Statemachine (E115)

 

 

 

How to use vector of ports here with type bool from StateMachine and how to bind it with the port of Timer module??

 

 

 

 


Viewing all articles
Browse latest Browse all 595

Trending Articles