-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
197,182 additions
and
191,635 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
=== d18_nikhildj_mac === | ||
|
||
Number of wires: 825 | ||
Number of wire bits: 1663 | ||
Number of public wires: 538 | ||
Number of public wire bits: 1376 | ||
Number of wires: 794 | ||
Number of wire bits: 1621 | ||
Number of public wires: 541 | ||
Number of public wire bits: 1368 | ||
Number of memories: 0 | ||
Number of memory bits: 0 | ||
Number of processes: 0 | ||
Number of cells: 419 | ||
$_ANDNOT_ 98 | ||
$_AND_ 26 | ||
$_DFF_P_ 46 | ||
$_MUX_ 30 | ||
$_NAND_ 10 | ||
$_NOR_ 11 | ||
$_NOT_ 10 | ||
Number of cells: 410 | ||
$_ANDNOT_ 72 | ||
$_AND_ 25 | ||
$_DFFE_PP_ 35 | ||
$_DFF_P_ 15 | ||
$_MUX_ 49 | ||
$_NAND_ 12 | ||
$_NOR_ 8 | ||
$_NOT_ 8 | ||
$_ORNOT_ 10 | ||
$_OR_ 65 | ||
$_OR_ 41 | ||
$_SDFFCE_PN0P_ 1 | ||
$_SDFFE_NP0P_ 4 | ||
$_SDFFE_PP0N_ 1 | ||
$_SDFFE_PP0P_ 21 | ||
$_SDFFE_PP1P_ 2 | ||
$_SDFF_NP0_ 16 | ||
$_SDFF_PN0_ 1 | ||
$_SDFF_PP0_ 19 | ||
$_XNOR_ 14 | ||
$_XOR_ 35 | ||
$_SDFF_PP0_ 40 | ||
$_XNOR_ 16 | ||
$_XOR_ 34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
module test; | ||
|
||
logic reset, clock; | ||
logic mac_carry_out, finish, shiftout, end_mul; | ||
logic [11:0] io_out; | ||
logic start, shiftA, shiftB, shift, do_next; | ||
|
||
assign {mac_carry_out, finish, shiftout, end_mul} = io_out[11:8]; | ||
|
||
my_chip dut ( | ||
.clock(clock), | ||
.reset(reset), | ||
.io_in({start, shiftA, shiftB, shift, do_next, 7'b0}), | ||
.io_out(io_out) | ||
); | ||
|
||
initial begin | ||
clock = 0; | ||
forever #5 clock = ~clock; | ||
end | ||
|
||
task shiftIn (input [7:0] d1, input [7:0] d2); | ||
begin | ||
for (int i = 0; i < 8; i += 1) begin | ||
shiftA = d1[7-i]; shiftB = d2[7-i]; | ||
shift = 1; @(posedge clock); @(posedge clock); | ||
shift = 0; @(posedge clock); @(posedge clock); | ||
end | ||
|
||
end | ||
endtask | ||
|
||
logic [19:0] dout; | ||
task shiftOut (); | ||
begin | ||
for (int i = 0; i < 20; i += 1) begin | ||
dout[i] = shiftout; | ||
shift = 1; @(posedge clock); @(posedge clock); | ||
shift = 0; @(posedge clock); @(posedge clock); | ||
end | ||
|
||
end | ||
endtask | ||
|
||
initial begin | ||
reset = 1; | ||
start = 0; | ||
shiftA = 0; | ||
shiftB = 0; | ||
shift = 0; | ||
do_next = 0; | ||
|
||
$monitor($time,, "finish=%d, end_mul=%d, shiftout=%d, start=%d, shiftA=%d, shiftB=%d, shift=%d", | ||
finish, end_mul, shiftout, start, shiftA, shiftB, shift); | ||
|
||
@(posedge clock) | ||
@(posedge clock) | ||
reset = 0; | ||
@(posedge clock) | ||
@(posedge clock) | ||
|
||
|
||
start = 1; | ||
@(posedge clock); | ||
start = 0; | ||
@(posedge clock); | ||
@(posedge clock); | ||
|
||
repeat(100) @(posedge clock); | ||
|
||
for (int i = 0; i < 9; i++) begin | ||
shiftIn(i+2, i+3); | ||
repeat(20) @(posedge clock); | ||
do_next = 1; | ||
@(posedge clock) | ||
do_next = 0; | ||
repeat(100) @(posedge clock); | ||
end | ||
|
||
while (!finish) @(posedge clock); | ||
@(posedge clock); | ||
@(posedge clock); | ||
shiftOut(); | ||
$display("result = %d (exp = 438)", dout); | ||
|
||
$finish; | ||
end | ||
|
||
endmodule |
Oops, something went wrong.