Skip to content

Commit

Permalink
COMPUTE_SLICES global parameter as simple define
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Mar 19, 2024
1 parent cd2ba62 commit 57fb840
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/1_58bit_mul.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

`define default_netname none

module tt_um_rejunity_1_58bit #(
parameter integer COMPUTE_SLICES = `COMPUTE_SLICES
) (
`define COMPUTE_SLICES 1

module tt_um_rejunity_1_58bit (
input wire [7:0] ui_in, // Dedicated inputs
output wire [7:0] uo_out, // Dedicated outputs
input wire [7:0] uio_in, // IOs: Input path
Expand Down Expand Up @@ -58,7 +58,7 @@ module tt_um_rejunity_1_58bit #(
// @TODO: special weight to initiate readout
wire initiate_read_out = !ena;

systolic_array #(.SLICES(COMPUTE_SLICES)) systolic_array (
systolic_array systolic_array (
.clk(clk),
.reset(reset),

Expand All @@ -77,7 +77,7 @@ module tt_um_rejunity_1_58bit #(
endmodule

module systolic_array #(
parameter integer SLICES = 1
parameter integer SLICES = `COMPUTE_SLICES
) (
input wire clk,
input wire reset,
Expand Down
4 changes: 0 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Makefile
# See https://docs.cocotb.org/en/stable/quickstart.html for more info

# global parameters
COMPUTE_SLICES ?= 2
COMPILE_ARGS += -DCOMPUTE_SLICES=$(COMPUTE_SLICES)

# defaults
SIM ?= icarus
TOPLEVEL_LANG ?= verilog
Expand Down
2 changes: 1 addition & 1 deletion test/tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module tb ();
parameter integer COMPUTE_SLICES = `COMPUTE_SLICES;

// Replace tt_um_example with your module name:
tt_um_rejunity_1_58bit #(.COMPUTE_SLICES(COMPUTE_SLICES)) user_project (
tt_um_rejunity_1_58bit user_project (
// Include power ports for the Gate Level test:
`ifdef GL_TEST
.VPWR(1'b1),
Expand Down

0 comments on commit 57fb840

Please sign in to comment.