From 2cd2a936aab93ebe53f57412ebbefacb0929f651 Mon Sep 17 00:00:00 2001 From: KaitlynKeil Date: Thu, 12 Oct 2017 19:37:46 -0400 Subject: [PATCH 01/11] Pushing homework to work on tomorrow --- decoder1to32.v | 8 ++++++++ mux32to1by1.v | 8 ++++++++ mux32to1by32.v | 45 +++++++++++++++++++++++++++++++++++++++++++++ register32.v | 14 ++++++++++++++ register32zero.v | 10 ++++++++++ 5 files changed, 85 insertions(+) create mode 100644 decoder1to32.v create mode 100644 mux32to1by1.v create mode 100644 mux32to1by32.v create mode 100644 register32.v create mode 100644 register32zero.v diff --git a/decoder1to32.v b/decoder1to32.v new file mode 100644 index 0000000..ae5f662 --- /dev/null +++ b/decoder1to32.v @@ -0,0 +1,8 @@ +module decoder1to32 +( +output[31:0] out, +input enable, +input[4:0] address +); + assign out = enable< Date: Tue, 17 Oct 2017 10:13:51 -0400 Subject: [PATCH 04/11] Updating test cases --- regfile.t.v | 289 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 286 insertions(+), 3 deletions(-) diff --git a/regfile.t.v b/regfile.t.v index 38d0da7..7a0d931 100644 --- a/regfile.t.v +++ b/regfile.t.v @@ -124,6 +124,291 @@ output reg Clk $display("Test Case 1 Failed"); end + // Test Case 1.0: + // Write nothing, verify that 2 is '42' and nothing else has changed + WriteRegister = 5'd2; + WriteData = 32'd42; + RegWrite = 0; + ReadRegister1 = 5'd2; + ReadRegister2 = 5'd0; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 != 0)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.0 Failed"); + end + + ReadRegister2 = 5'd1; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.1 Failed"); + end + + ReadRegister2 = 5'd3; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.3 Failed"); + end + + ReadRegister2 = 5'd4; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.4 Failed"); + end + + ReadRegister2 = 5'd5; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.5 Failed"); + end + + ReadRegister2 = 5'd6; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.6 Failed"); + end + + ReadRegister2 = 5'd7; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.7 Failed"); + end + + ReadRegister2 = 5'd8; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.8 Failed"); + end + + ReadRegister2 = 5'd9; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.9 Failed"); + end + + ReadRegister2 = 5'd10; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.10 Failed"); + end + + ReadRegister2 = 5'd11; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.11 Failed"); + end + + ReadRegister2 = 5'd12; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.12 Failed"); + end + + ReadRegister2 = 5'd13; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.13 Failed"); + end + + ReadRegister2 = 5'd14; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.14 Failed"); + end + + ReadRegister2 = 5'd15; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.15 Failed"); + end + + ReadRegister2 = 5'd16; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.16 Failed"); + end + + ReadRegister2 = 5'd17; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.17 Failed"); + end + + ReadRegister2 = 5'd18; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.18 Failed"); + end + + ReadRegister2 = 5'd19; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.19 Failed"); + end + + ReadRegister2 = 5'd20; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.20 Failed"); + end + + ReadRegister2 = 5'd21; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.21 Failed"); + end + + ReadRegister2 = 5'd22; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.22 Failed"); + end + + ReadRegister2 = 5'd23; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.23 Failed"); + end + + ReadRegister2 = 5'd24; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.24 Failed"); + end + + ReadRegister2 = 5'd25; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.25 Failed"); + end + + ReadRegister2 = 5'd26; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.26 Failed"); + end + + ReadRegister2 = 5'd27; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.27 Failed"); + end + + ReadRegister2 = 5'd28; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.28 Failed"); + end + + ReadRegister2 = 5'd29; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.29 Failed"); + end + + ReadRegister2 = 5'd30; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.30 Failed"); + end + + ReadRegister2 = 5'd31; + #5 Clk=1; #5 Clk=0; // Generate single clock pulse + + // Verify expectations and report test result + if((ReadData1 != 42) || (ReadData2 !== 32'bx)) begin + dutpassed = 0; // Set to 'false' on failure + $display("Test Case 1.31 Failed"); + end + // Test Case 2: // Write '15' to register 2, verify with Read Ports 1 and 2 // (Fails with example register file, but should pass with yours) @@ -208,11 +493,9 @@ output reg Clk if((ReadData1 !== 32'bx) || (ReadData2 !== 32'bx)) begin dutpassed = 0; - $display("Test Case 6 Failed"); + $display("Test Case 7 Failed"); end - $display("Read 1: %d Read 2: %d", ReadData1, ReadData2); - // All done! Wait a moment and signal test completion. #5 endtest = 1; From 42db5b162661e892ded13233570280c4b53a5328 Mon Sep 17 00:00:00 2001 From: KaitlynKeil Date: Wed, 18 Oct 2017 09:05:13 -0400 Subject: [PATCH 05/11] Putting everything together --- hw4written.pdf | Bin 0 -> 10699 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 hw4written.pdf diff --git a/hw4written.pdf b/hw4written.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8d114b059f43b35081defdf3df3bdbb848cc4899 GIT binary patch literal 10699 zcmcI~1yr2NvMw%zI|K+raG$~5-60U%83>ZW-Q6KTa0yOuf&~fg76OFeL4pM*KnN1J z13PEmz0W>(z4z8zx7YgD-+xVYRd;pwRCV=7r!Fna24?35(EZ%}*f#(G13^Fsb6bG0 zFpxvb%Mk+PkTP>Mvv;rtaHyMELtKEIFa}M4s3-sewY+Bp+!OxZ;(-ysp=4v}0yN;h z=QjdyNIAGcU4h`gw&eOtOLb=li>DA*paBQ0Lon44Pgfv^!V8#6$=`3O-){w&FkLls zTZn}#@V=M23hK%ddNP_IAn!xh{v?=4sepm}|DbUK!JvN-xq#sNkv|OVuU)+F{XYkH zZwqG#Y&d@ygF_SI;^5|N0kh8ikTd}tDiBK>Gf4+epuxQ=J^@Z3FPIb7Z%qeRGgk^G&iUHn!^4`ZWjs>ieZGH(&@rGI)>`h zA!|y;yD@HPR7xwx4h!zOc$BbL_7P-zxZrFF+h<;c=Gy5XBVL#t_TX>eTt|L(IlX(A zp(j}}ev{geH&S#9H#+vL_+TJ=Fk?r*7u14-4{PRRB07 zZCqW{A~N0OQj@Y5;*^+{s}XBp}tp9XzZ6Pbc^XxJ6+90xjK6f z(k2q>L>`tlpQieNO4W!&kqZw|kK5*&qYICtql=uCmUSy97E^dr5GgBhMPN5$tV24^ zVqb0)l?(-TO#d1ox~DL90s}75Ah|}AIFONvg^8(xxuU#cf+P(-6AmspT!nkJ1|>O| zrU>$qQLjbdE5lM3f+mRH5CET+DhnJ)IHVH820Bi8zMv_OEokS{WO!M72FE}kqyOux zQ9*C7u~D>|dQoNelp%y@<`UzKcsIGzxXCx{ZB$wRBPEv1#<&A|xz^g?fG8<5HiSr`tWetU6M;>snpR_vocr2g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Y9haNX)BfQBC4B+EQoT2r%p&d zGCp}9IxGICE&W%VofHi4z(8gH6USe!nmwH%RsawX%mo1b zS%ADeJX}0LE8w3rFbvOiUx3j6rt$uh2Iho8>;8?8lOJ}+{ckjG&_DTjxnZ{WJ0B-E z-#_>`xdr~AmzV#adU*vvFvQ*89vHmuUwi;pXEPgni1Pzd@~MqCXE&v^!jGF9!0bOB&!T Date: Wed, 18 Oct 2017 09:06:12 -0400 Subject: [PATCH 06/11] Removing out of date files --- decoder1to32.v | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 decoder1to32.v diff --git a/decoder1to32.v b/decoder1to32.v deleted file mode 100644 index ae5f662..0000000 --- a/decoder1to32.v +++ /dev/null @@ -1,8 +0,0 @@ -module decoder1to32 -( -output[31:0] out, -input enable, -input[4:0] address -); - assign out = enable< Date: Wed, 18 Oct 2017 09:07:32 -0400 Subject: [PATCH 07/11] Removing out of date files --- register32zero.v | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 register32zero.v diff --git a/register32zero.v b/register32zero.v deleted file mode 100644 index c7118aa..0000000 --- a/register32zero.v +++ /dev/null @@ -1,10 +0,0 @@ -module register32zero #( - parameter WIDTH = 32 -) ( - output reg [WIDTH-1:0] q, - input [WIDTH-1:0] d, - input wrenable, - input clk -); - q = '0; -endmodule \ No newline at end of file From f35e73e7d6f251b3f5a0d0f18b52b4bfd295b2df Mon Sep 17 00:00:00 2001 From: KaitlynKeil Date: Wed, 18 Oct 2017 09:07:43 -0400 Subject: [PATCH 08/11] Removing out of date files --- register32.v | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 register32.v diff --git a/register32.v b/register32.v deleted file mode 100644 index 603e002..0000000 --- a/register32.v +++ /dev/null @@ -1,14 +0,0 @@ -module register32 #( - parameter WIDTH = 32 -) ( - output reg [WIDTH-1:0] q, - input [WIDTH-1:0] d, - input wrenable, - input clk -); - always @(posedge clk) begin - if(wrenable) begin - q = d; - end - end -endmodule \ No newline at end of file From 1cec593f0725b58d6e3d79b64ae9583c008d3698 Mon Sep 17 00:00:00 2001 From: KaitlynKeil Date: Wed, 18 Oct 2017 09:07:57 -0400 Subject: [PATCH 09/11] Removing out of date files --- mux32to1by32.v | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 mux32to1by32.v diff --git a/mux32to1by32.v b/mux32to1by32.v deleted file mode 100644 index fc25d52..0000000 --- a/mux32to1by32.v +++ /dev/null @@ -1,45 +0,0 @@ -module mux32to1by32 -( -output[31:0] out, -input[4:0] address, -input[31:0] input0, input1, input2, input3, input4, input5, input6, input7, input8, input9, input10, input11, input12, input13, input14, input15, input16, input17, input18, input19, input20, input21, input22, input23, input24, input25, input26, input27, input28, input29, input30, input31 -); - - wire[31:0] mux[31:0]; // Create a 2D array of wires - - // Connect the sources of the array - assign mux[0] = input0; - assign mux[1] = input1; - assign mux[2] = input2; - assign mux[3] = input3; - assign mux[4] = input4; - assign mux[5] = input5; - assign mux[6] = input6; - assign mux[7] = input7; - assign mux[8] = input8; - assign mux[9] = input9; - assign mux[10] = input10; - assign mux[11] = input11; - assign mux[12] = input12; - assign mux[13] = input13; - assign mux[14] = input14; - assign mux[15] = input15; - assign mux[16] = input16; - assign mux[17] = input17; - assign mux[18] = input18; - assign mux[19] = input19; - assign mux[20] = input20; - assign mux[21] = input21; - assign mux[22] = input22; - assign mux[23] = input23; - assign mux[24] = input24; - assign mux[25] = input25; - assign mux[26] = input26; - assign mux[27] = input27; - assign mux[28] = input28; - assign mux[29] = input29; - assign mux[30] = input30; - assign mux[31] = input31; - - assign out = mux[address]; // Connect the output of the array -endmodule \ No newline at end of file From 833e7891e266e6260cb611ebdb503f14babbcebb Mon Sep 17 00:00:00 2001 From: KaitlynKeil Date: Wed, 18 Oct 2017 09:08:25 -0400 Subject: [PATCH 10/11] Removing out of date files --- mux32to1by1.v | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 mux32to1by1.v diff --git a/mux32to1by1.v b/mux32to1by1.v deleted file mode 100644 index 2fcb12f..0000000 --- a/mux32to1by1.v +++ /dev/null @@ -1,8 +0,0 @@ -module mux32to1by1 -( - output out, - input[4:0] address, - input[31:0] inputs -); - assign outputofmux = inputs[address]; -endmodule \ No newline at end of file From df89fba345fb56fa2468a82420e6126d4816f2d7 Mon Sep 17 00:00:00 2001 From: KaitlynKeil Date: Wed, 18 Oct 2017 09:14:58 -0400 Subject: [PATCH 11/11] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index ddf0003..e9d4c40 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,20 @@ # CompArch HW b0100: Register File # +Kaitlyn Keil + +## Instructions to Run ## + +Run code with: + +``` +>>>iverilog -o regfile.t.v +>>>./ +``` + +The terminal will display whether all the tests passed (```DUT Passed: 1```) or failed, along with the test case that failed. + +Written work is in the pdf [hw4written.pdf](https://github.com/KaitlynKeil/HW4/blob/master/hw4written.pdf). + **Due:** Monday, October 16 This homework is intended to introduce behavioral Verilog and practice test bench design. You will create your first memory, a register file, which will be reused in your CPU design.