Jump to content

"Error: (E529) insert module failed: simulation running" When trying to do sc_start


PokeGent

Recommended Posts

Hello! I am trying to run a testbench to simulate a simple averager circuit and I am not sure why I am getting this error. Other examples on the site don't seem to apply and I'd love any help or tips I can get. I am hoping its some simple syntax or ordering error that I am doing wrong. Here is what I am doing for the simulation:

#include "averageTB.h"

int sc_main(int argc, char* argv[]) {

	averageTB* myAVGTB = new averageTB("Testbench");

	sc_trace_file* VCDFile;
	VCDFile = sc_create_vcd_trace_file("averageTB");
	sc_trace(VCDFile, myAVGTB->rst, "rst");
	sc_trace(VCDFile, myAVGTB->clk, "clk");
	sc_trace(VCDFile, myAVGTB->start, "start");
	sc_trace(VCDFile, myAVGTB->stop, "stop");
	sc_trace(VCDFile, myAVGTB->inBus, "inBus");
	sc_trace(VCDFile, myAVGTB->outBus, "outBus");

	sc_start(2000, SC_NS);

	return 0;
}

Here is the code for the testbench that I wrote as well:

#include "HW4ece.h"

SC_MODULE(averageTB) {

	int ij;
	int NumOfInputs;
	sc_signal<sc_logic> rst, clk, start, stop, enableReg, selMux, selTri;
	sc_signal<sc_lv<8>> inBus, outBus;
	accAverage_Top* myTop;

	SC_CTOR(averageTB) {

		myTop = new accAverage_Top("Top-module");
		myTop->rst(rst);
		myTop->clk(clk);
		myTop->start(start);
		myTop->stop(stop);
		myTop->inBus(inBus);
		myTop->outBus(outBus);


		SC_THREAD(resetting);
		SC_THREAD(clocking);
		SC_THREAD(main_task);
		SC_METHOD(display);
		sensitive << clk << rst;
	}

	void resetting();
	void clocking();
	void main_task();
	void display();
};

 

Link to comment
Share on other sites

Skimming over your code snippets, I don't see a line, which would cause the error from your thread title. Try to reduce your code to a self-contained example, which exposes the problem. As the error message states, you cannot create new modules after elaboration has finished and simulation is running.

Link to comment
Share on other sites

13 hours ago, maehne said:

Skimming over your code snippets, I don't see a line, which would cause the error from your thread title. Try to reduce your code to a self-contained example, which exposes the problem. As the error message states, you cannot create new modules after elaboration has finished and simulation is running.

Hmm yes, I should read the subject too...

Link to comment
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...