data/full_repos/permissive/118303050/src/lab_4/datapath.v
1: b"%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:74: Cannot find file containing module: 'hazard'\n hazard h(\n ^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/118303050/src/lab_4,data/full_repos/permissive/118303050/hazard\n             data/full_repos/permissive/118303050/src/lab_4,data/full_repos/permissive/118303050/hazard.v\n             data/full_repos/permissive/118303050/src/lab_4,data/full_repos/permissive/118303050/hazard.sv\n             hazard\n             hazard.v\n             hazard.sv\n             obj_dir/hazard\n             obj_dir/hazard.v\n             obj_dir/hazard.sv\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:99: Cannot find file containing module: 'mux2'\n mux2 #(32) pcbrmux(pcplus4F,pcbranchD,pcsrcD,pcnextbrFD);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:100: Cannot find file containing module: 'mux2'\n mux2 #(32) pcmux(pcnextbrFD,\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:105: Cannot find file containing module: 'regfile'\n regfile rf(clk,regwriteW,rsD,rtD,writeregW,resultW,srcaD,srcbD);\n ^~~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:108: Cannot find file containing module: 'pc'\n pc #(32) pcreg(clk,rst,~stallF,pcnextFD,pcF);\n ^~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:109: Cannot find file containing module: 'adder'\n adder pcadd1(pcF,32'b100,pcplus4F);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:111: Cannot find file containing module: 'flopenr'\n flopenr #(32) r1D(clk,rst,~stallD,pcplus4F,pcplus4D);\n ^~~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:112: Cannot find file containing module: 'flopenrc'\n flopenrc #(32) r2D(clk,rst,~stallD,flushD,instrF,instrD);\n ^~~~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:113: Cannot find file containing module: 'signext'\n signext se(instrD[15:0],signimmD);\n ^~~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:114: Cannot find file containing module: 'sl2'\n sl2 immsh(signimmD,signimmshD);\n ^~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:115: Cannot find file containing module: 'adder'\n adder pcadd2(pcplus4D,signimmshD,pcbranchD);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:116: Cannot find file containing module: 'mux2'\n mux2 #(32) forwardamux(srcaD,aluoutM,forwardaD,srca2D);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:117: Cannot find file containing module: 'mux2'\n mux2 #(32) forwardbmux(srcbD,aluoutM,forwardbD,srcb2D);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:118: Cannot find file containing module: 'eqcmp'\n eqcmp comp(srca2D,srcb2D,equalD);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:127: Cannot find file containing module: 'floprc'\n floprc #(32) r1E(clk,rst,flushE,srcaD,srcaE);\n ^~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:128: Cannot find file containing module: 'floprc'\n floprc #(32) r2E(clk,rst,flushE,srcbD,srcbE);\n ^~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:129: Cannot find file containing module: 'floprc'\n floprc #(32) r3E(clk,rst,flushE,signimmD,signimmE);\n ^~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:130: Cannot find file containing module: 'floprc'\n floprc #(5) r4E(clk,rst,flushE,rsD,rsE);\n ^~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:131: Cannot find file containing module: 'floprc'\n floprc #(5) r5E(clk,rst,flushE,rtD,rtE);\n ^~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:132: Cannot find file containing module: 'floprc'\n floprc #(5) r6E(clk,rst,flushE,rdD,rdE);\n ^~~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:134: Cannot find file containing module: 'mux3'\n mux3 #(32) forwardaemux(srcaE,resultW,aluoutM,forwardaE,srca2E);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:135: Cannot find file containing module: 'mux3'\n mux3 #(32) forwardbemux(srcbE,resultW,aluoutM,forwardbE,srcb2E);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:136: Cannot find file containing module: 'mux2'\n mux2 #(32) srcbmux(srcb2E,signimmE,alusrcE,srcb3E);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:137: Cannot find file containing module: 'alu'\n alu alu(srca2E,srcb3E,alucontrolE,aluoutE);\n ^~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:138: Cannot find file containing module: 'mux2'\n mux2 #(5) wrmux(rtE,rdE,regdstE,writeregE);\n ^~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:141: Cannot find file containing module: 'flopr'\n flopr #(32) r1M(clk,rst,srcb2E,writedataM);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:142: Cannot find file containing module: 'flopr'\n flopr #(32) r2M(clk,rst,aluoutE,aluoutM);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:143: Cannot find file containing module: 'flopr'\n flopr #(5) r3M(clk,rst,writeregE,writeregM);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:146: Cannot find file containing module: 'flopr'\n flopr #(32) r1W(clk,rst,aluoutM,aluoutW);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:147: Cannot find file containing module: 'flopr'\n flopr #(32) r2W(clk,rst,readdataM,readdataW);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:148: Cannot find file containing module: 'flopr'\n flopr #(5) r3W(clk,rst,writeregM,writeregW);\n ^~~~~\n%Error: data/full_repos/permissive/118303050/src/lab_4/datapath.v:149: Cannot find file containing module: 'mux2'\n mux2 #(32) resmux(aluoutW,readdataW,memtoregW,resultW);\n ^~~~\n%Error: Exiting due to 32 error(s)\n"
module datapath(
	input wire clk,rst,

	output wire[31:0] pcF,
	input wire[31:0] instrF,

	input wire pcsrcD,branchD,
	input wire jumpD,
	output wire equalD,
	output wire[5:0] opD,functD,

	input wire memtoregE,
	input wire alusrcE,regdstE,
	input wire regwriteE,
	input wire[2:0] alucontrolE,
	output wire flushE,

	input wire memtoregM,
	input wire regwriteM,
	output wire[31:0] aluoutM,writedataM,
	input wire[31:0] readdataM,

	input wire memtoregW,
	input wire regwriteW
    );
	

	wire stallF;

	wire [31:0] pcnextFD,pcnextbrFD,pcplus4F,pcbranchD;

	wire [31:0] pcplus4D,instrD;
	wire forwardaD,forwardbD;
	wire [4:0] rsD,rtD,rdD;
	wire flushD,stallD; 
	wire [31:0] signimmD,signimmshD;
	wire [31:0] srcaD,srca2D,srcbD,srcb2D;

	wire [1:0] forwardaE,forwardbE;
	wire [4:0] rsE,rtE,rdE;
	wire [4:0] writeregE;
	wire [31:0] signimmE;
	wire [31:0] srcaE,srca2E,srcbE,srcb2E,srcb3E;
	wire [31:0] aluoutE;

	wire [4:0] writeregM;

	wire [4:0] writeregW;
	wire [31:0] aluoutW,readdataW,resultW;


	hazard h(

		stallF,

		rsD,rtD,
		branchD,
		forwardaD,forwardbD,
		stallD,

		rsE,rtE,
		writeregE,
		regwriteE,
		memtoregE,
		forwardaE,forwardbE,
		flushE,

		writeregM,
		regwriteM,
		memtoregM,

		writeregW,
		regwriteW
		);


	mux2 #(32) pcbrmux(pcplus4F,pcbranchD,pcsrcD,pcnextbrFD);
	mux2 #(32) pcmux(pcnextbrFD,
		{pcplus4D[31:28],instrD[25:0],2'b00},
		jumpD,pcnextFD);


	regfile rf(clk,regwriteW,rsD,rtD,writeregW,resultW,srcaD,srcbD);


	pc #(32) pcreg(clk,rst,~stallF,pcnextFD,pcF);
	adder pcadd1(pcF,32'b100,pcplus4F);

	flopenr #(32) r1D(clk,rst,~stallD,pcplus4F,pcplus4D);
	flopenrc #(32) r2D(clk,rst,~stallD,flushD,instrF,instrD);
	signext se(instrD[15:0],signimmD);
	sl2 immsh(signimmD,signimmshD);
	adder pcadd2(pcplus4D,signimmshD,pcbranchD);
	mux2 #(32) forwardamux(srcaD,aluoutM,forwardaD,srca2D);
	mux2 #(32) forwardbmux(srcbD,aluoutM,forwardbD,srcb2D);
	eqcmp comp(srca2D,srcb2D,equalD);

	assign opD = instrD[31:26];
	assign functD = instrD[5:0];
	assign rsD = instrD[25:21];
	assign rtD = instrD[20:16];
	assign rdD = instrD[15:11];


	floprc #(32) r1E(clk,rst,flushE,srcaD,srcaE);
	floprc #(32) r2E(clk,rst,flushE,srcbD,srcbE);
	floprc #(32) r3E(clk,rst,flushE,signimmD,signimmE);
	floprc #(5) r4E(clk,rst,flushE,rsD,rsE);
	floprc #(5) r5E(clk,rst,flushE,rtD,rtE);
	floprc #(5) r6E(clk,rst,flushE,rdD,rdE);

	mux3 #(32) forwardaemux(srcaE,resultW,aluoutM,forwardaE,srca2E);
	mux3 #(32) forwardbemux(srcbE,resultW,aluoutM,forwardbE,srcb2E);
	mux2 #(32) srcbmux(srcb2E,signimmE,alusrcE,srcb3E);
	alu alu(srca2E,srcb3E,alucontrolE,aluoutE);
	mux2 #(5) wrmux(rtE,rdE,regdstE,writeregE);


	flopr #(32) r1M(clk,rst,srcb2E,writedataM);
	flopr #(32) r2M(clk,rst,aluoutE,aluoutM);
	flopr #(5) r3M(clk,rst,writeregE,writeregM);


	flopr #(32) r1W(clk,rst,aluoutM,aluoutW);
	flopr #(32) r2W(clk,rst,readdataM,readdataW);
	flopr #(5) r3W(clk,rst,writeregM,writeregW);
	mux2 #(32) resmux(aluoutW,readdataW,memtoregW,resultW);
endmodule
module datapath(
	input wire clk,rst,

	output wire[31:0] pcF,
	input wire[31:0] instrF,

	input wire pcsrcD,branchD,
	input wire jumpD,
	output wire equalD,
	output wire[5:0] opD,functD,

	input wire memtoregE,
	input wire alusrcE,regdstE,
	input wire regwriteE,
	input wire[2:0] alucontrolE,
	output wire flushE,

	input wire memtoregM,
	input wire regwriteM,
	output wire[31:0] aluoutM,writedataM,
	input wire[31:0] readdataM,

	input wire memtoregW,
	input wire regwriteW
    );

	

	wire stallF;

	wire [31:0] pcnextFD,pcnextbrFD,pcplus4F,pcbranchD;

	wire [31:0] pcplus4D,instrD;
	wire forwardaD,forwardbD;
	wire [4:0] rsD,rtD,rdD;
	wire flushD,stallD; 
	wire [31:0] signimmD,signimmshD;
	wire [31:0] srcaD,srca2D,srcbD,srcb2D;

	wire [1:0] forwardaE,forwardbE;
	wire [4:0] rsE,rtE,rdE;
	wire [4:0] writeregE;
	wire [31:0] signimmE;
	wire [31:0] srcaE,srca2E,srcbE,srcb2E,srcb3E;
	wire [31:0] aluoutE;

	wire [4:0] writeregM;

	wire [4:0] writeregW;
	wire [31:0] aluoutW,readdataW,resultW;


	hazard h(

		stallF,

		rsD,rtD,
		branchD,
		forwardaD,forwardbD,
		stallD,

		rsE,rtE,
		writeregE,
		regwriteE,
		memtoregE,
		forwardaE,forwardbE,
		flushE,

		writeregM,
		regwriteM,
		memtoregM,

		writeregW,
		regwriteW
		);


	mux2 #(32) pcbrmux(pcplus4F,pcbranchD,pcsrcD,pcnextbrFD);
	mux2 #(32) pcmux(pcnextbrFD,
		{pcplus4D[31:28],instrD[25:0],2'b00},
		jumpD,pcnextFD);


	regfile rf(clk,regwriteW,rsD,rtD,writeregW,resultW,srcaD,srcbD);


	pc #(32) pcreg(clk,rst,~stallF,pcnextFD,pcF);
	adder pcadd1(pcF,32'b100,pcplus4F);

	flopenr #(32) r1D(clk,rst,~stallD,pcplus4F,pcplus4D);
	flopenrc #(32) r2D(clk,rst,~stallD,flushD,instrF,instrD);
	signext se(instrD[15:0],signimmD);
	sl2 immsh(signimmD,signimmshD);
	adder pcadd2(pcplus4D,signimmshD,pcbranchD);
	mux2 #(32) forwardamux(srcaD,aluoutM,forwardaD,srca2D);
	mux2 #(32) forwardbmux(srcbD,aluoutM,forwardbD,srcb2D);
	eqcmp comp(srca2D,srcb2D,equalD);

	assign opD = instrD[31:26];
	assign functD = instrD[5:0];
	assign rsD = instrD[25:21];
	assign rtD = instrD[20:16];
	assign rdD = instrD[15:11];


	floprc #(32) r1E(clk,rst,flushE,srcaD,srcaE);
	floprc #(32) r2E(clk,rst,flushE,srcbD,srcbE);
	floprc #(32) r3E(clk,rst,flushE,signimmD,signimmE);
	floprc #(5) r4E(clk,rst,flushE,rsD,rsE);
	floprc #(5) r5E(clk,rst,flushE,rtD,rtE);
	floprc #(5) r6E(clk,rst,flushE,rdD,rdE);

	mux3 #(32) forwardaemux(srcaE,resultW,aluoutM,forwardaE,srca2E);
	mux3 #(32) forwardbemux(srcbE,resultW,aluoutM,forwardbE,srcb2E);
	mux2 #(32) srcbmux(srcb2E,signimmE,alusrcE,srcb3E);
	alu alu(srca2E,srcb3E,alucontrolE,aluoutE);
	mux2 #(5) wrmux(rtE,rdE,regdstE,writeregE);


	flopr #(32) r1M(clk,rst,srcb2E,writedataM);
	flopr #(32) r2M(clk,rst,aluoutE,aluoutM);
	flopr #(5) r3M(clk,rst,writeregE,writeregM);


	flopr #(32) r1W(clk,rst,aluoutM,aluoutW);
	flopr #(32) r2W(clk,rst,readdataM,readdataW);
	flopr #(5) r3W(clk,rst,writeregM,writeregW);
	mux2 #(32) resmux(aluoutW,readdataW,memtoregW,resultW);
endmodule