Jump to content
Yash Jain

no match for ‘operator|’

Recommended Posts

I am getting this error for my wait()

Quote

no match for ‘operator|’ (operand types are ‘sc_core::sc_event_finder’ and ‘sc_core::sc_event_finder’)

 

#include "systemc.h"

SC_MODULE(server){
	sc_in<bool> begin1{"begin1"}, begin2{"begin2"}, begin3{"begin3"};
	sc_in<bool> end1{"end1"}, end2{"end2"}, end3{"end3"};
	sc_in<bool> incoming1{"incoming1"}, incoming2{"incoming2"}, incoming3{"incoming3"};
	sc_out<bool> free{"free"};
	sc_out<bool> outgoing1{"outgoing1"};
	sc_out<bool> outgoing2{"outgoing2"};
	sc_out<bool> outgoing3{"outgoing3"};

	void monitor(){
		free = true;
		outgoing1 = false;
		outgoing2 = false;
		outgoing3 = false;

		while(true){
			cout << "Inside this loop" << endl;
			wait(incoming1.pos() | incoming2.pos() | incoming3.pos());
			cout << "After first wait" << endl;

			//Mobile 1
			if(incoming1 == true){
				cout << "Mobile 1 received." << endl;
				while(!free); // Wait for the server to free up

				//Now that the server has freed up, proceed
				outgoing1 = true;
				free = false;
				wait(begin1);
				cout << "Begin1 @" << sc_simulation_time() << endl;
				wait(end1);
				cout << "End1 @" << sc_simulation_time() << endl;
				free = true;
			}

			//Mobile 2
			if(incoming2 == true){
				cout << "Mobile 2 received." << endl;
				while(!free);// Wait for the server to free up

				//Now that the server has freed up, proceed
				outgoing2 = true;
				free = false;
				wait(begin2);
				cout << "Begin2 @" << sc_simulation_time() << endl;
				wait(end2);
				cout << "End2 @" << sc_simulation_time() << endl;
				free = true;
			}

			//Mobile 3
			if(incoming3 == true){
				cout << "Mobile 3 received." << endl;
				while(!free);// Wait for the server to free up

				//Now that the server has freed up, proceed
				outgoing3 = true;
				free = false;
				wait(begin3);
				cout << "Begin3 @" << sc_simulation_time() << endl;
				wait(end3);
				cout << "End3 @" << sc_simulation_time() << endl;
				free = true;
			}
		}
	}

	SC_CTOR(server){
		//outgoing1 = false;
		//outgoing2 = false;
		//outgoing3 = false;'
		cout << "Started" << endl;
		SC_THREAD(monitor);
		//sensitive << incoming1.pos() << incoming2.pos() << incoming3.pos();
	}
};

Any suggestions on what the problem is?

Share this post


Link to post
Share on other sites

Just as explanation: pos() returns an event_finder (a proxy object which allows to use an event which is not yet available) while posedge_event() returns the event itself. And the operator|() is ony defined for sc_event.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...