You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/design_notebooks/2025fall/lz3007.md
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ We read the documentations on the [instruction set](https://user.eng.umd.edu/~bl
23
23
24
24
We consulted Noah about the inputs and outputs of the PC. From my interpretation, he explained that there are 3 possible jumps for the output address: incrementing of 1, jumping to register B (JALR instruction), and jumping to the immediate value (BEQ instruction). For all 3 possible jumps, there should be an input with the 16-bit address. A multiplexer, given an input from another module, is used to choose which address would be the one the PC would actually point to.
25
25
26
-
My partner and I had some differences in our interpretations, so we decided to write our code in separate files and push both versions to the repository ([Mine](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/program_counter_2.v) and [My Partner's](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/program_counter.v)).
26
+
My partner and I had some differences in our interpretations, so we decided to write our code in separate files and push both versions to the repository ([My PC](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/pc2.v) and [My Partner's PC](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/program_counter.v)).
27
27
28
28
**Remaining Questions/Notes:** We are unable to test our PC implementations, so we are not sure if either of them are correct. Since we are both taking Computer Architecture this semester, we are not yet sure how the ALU, PC, instruction memory, etc. work together.
29
29
@@ -45,7 +45,7 @@ The outputs, EQ (1-bit) and alu_out (16-bit), are selected based on the followin
45
45
46
46
EQ is always being set to (src1 == src2) for every operation.
47
47
48
-
For this week's project, my partner and I worked separately, meeting once to check each other's progress. Therefore, we worked on separate alu files: [Mine](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/alu2.v) and [My Partner's](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/alu.v).
48
+
For this week's project, my partner and I worked separately, meeting once to check each other's progress. Therefore, we worked on separate alu files: [My ALU](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/alu2.v) and [My Partner's ALU](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/alu.v).
49
49
50
50
**Remaining Question:** When fixing the PC, I was confused on why the reset input is negative and why the immediate value is inputted as 7-bit, not 16-bit.
51
51
When working on the ALU, I had the following questions: When do you decide to make an input/output a register? When do you use a clock and when do you not (depending on if it iterates?).
@@ -70,6 +70,30 @@ There were many syntax and logic errors while testing my code with the testbench
70
70
1) WE_rf bit is on
71
71
2) source register is not register 0
72
72
73
-
[Link to the Code](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/register2.v)
**Notes:** As I am writing this week's design notebook, I realize that it doesn't make sense to update the register using the value of the current instruction's rA. So, I am unsure as to why my current code (which does the above) passes all the test cases.
75
+
**Notes:** As I am writing this week's design notebook, I realize that it doesn't make sense to update the register using the value of the current instruction's rA. So, I am unsure as to why my current code (which does the above) passes all the test cases.
76
+
77
+
## Week 5: 10/06/2025 - 10/12/2025
78
+
79
+
* Fixed register file using the updated testbench, passed all tests
80
+
81
+
#### There was no new assignment for this week.
82
+
83
+
The previous testbench was incorrect because the Register File should not take the instruction, only the registers (rA, rB, rC). While fixing my Register File code using the fixed testbench, I realized the following about my code:
84
+
1. The Register File should NOT sign-extend or left shift the immediate value; in fact, the register does not take the immediate value as an input at all.
85
+
2. The opcode should not be an input for any of the modules, only the signals from the Control Unit and the outputs from other modules are inputs.
At the start, I created different test cases, like the verfication of the initial values in the memory, testing if the reg_out value was written to the address (alu_out) if WE_dmem = 0 (should not write), and overwriting previously modified memory data. One problem I had was that I was checking all 65536 memory locations, which is very inefficient. So, I changed the tests cases to only check the few memory addresses that were being tested.
94
+
95
+
The biggest problem that I encountered while writing the testbench was the verilog syntax and logic. Within an initial block, declaring an integer after an executable statements would cause errors and displaying text right after one another would also cause errors. However, all these errors would point to the $finish line at the very end of the code, so it was difficult to know which lines were actually causing errors.
96
+
97
+
[GitHub: Data Memory Testbench](https://github.com/Ghqlq/Processor-Design-Projects/blob/main/data_memory_tb2.v)
98
+
99
+
**Notes:** Wires cannot be declared inside an intial block. However, registers and integers can, but only at the top, before any executable statements.
0 commit comments