-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #464
- Loading branch information
1 parent
e218874
commit e3e43d2
Showing
9 changed files
with
233 additions
and
40 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
integration_tests/lakeroad/xilinx_muladd_0_stage_unsigned_13_bit.sv
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
2 changes: 1 addition & 1 deletion
2
integration_tests/lakeroad/xilinx_mulsub_1_stage_unsigned_14_bit.sv
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
46 changes: 46 additions & 0 deletions
46
integration_tests/lakeroad/xilinx_ultrascale_plus_dsp_internal_shift.v
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,46 @@ | ||
// RUN: outfile=$(mktemp) | ||
// RUN: racket $LAKEROAD_DIR/bin/main.rkt \ | ||
// RUN: --solver bitwuzla \ | ||
// RUN: --verilog-module-filepath %s \ | ||
// RUN: --architecture xilinx-ultrascale-plus \ | ||
// RUN: --template dsp \ | ||
// RUN: --out-format verilog \ | ||
// RUN: --top-module-name top \ | ||
// RUN: --verilog-module-out-signal out:48 \ | ||
// RUN: --pipeline-depth 0 \ | ||
// RUN: --module-name out \ | ||
// RUN: --input-signal 'c:(port c 47):47' \ | ||
// RUN: --timeout 90 \ | ||
// RUN: > $outfile | ||
// RUN: FileCheck %s < $outfile | ||
// RUN: if [ -z ${LAKEROAD_PRIVATE_DIR+x} ]; then \ | ||
// RUN: echo "Warning: LAKEROAD_PRIVATE_DIR is not set. Skipping simulation."; \ | ||
// RUN: exit 0; \ | ||
// RUN: else \ | ||
// RUN: python3 $LAKEROAD_DIR/bin/simulate_with_verilator.py \ | ||
// RUN: --test_module_name out \ | ||
// RUN: --ground_truth_module_name top \ | ||
// RUN: --max_num_tests=10000 \ | ||
// RUN: --verilog_filepath $outfile \ | ||
// RUN: --verilog_filepath %s \ | ||
// RUN: --pipeline_depth 0 \ | ||
// RUN: --output_signal out:48 \ | ||
// RUN: --input_signal c:47 \ | ||
// RUN: --verilator_include_dir "$LAKEROAD_PRIVATE_DIR/DSP48E2/" \ | ||
// RUN: --verilator_extra_arg='-DXIL_XECLIB' \ | ||
// RUN: --verilator_extra_arg='-Wno-UNOPTFLAT' \ | ||
// RUN: --verilator_extra_arg='-Wno-LATCH' \ | ||
// RUN: --verilator_extra_arg='-Wno-WIDTH' \ | ||
// RUN: --verilator_extra_arg='-Wno-STMTDLY' \ | ||
// RUN: --verilator_extra_arg='-Wno-CASEX' \ | ||
// RUN: --verilator_extra_arg='-Wno-TIMESCALEMOD' \ | ||
// RUN: --verilator_extra_arg='-Wno-PINMISSING'; \ | ||
// RUN: fi | ||
|
||
// TODO(@gussmith23): For some reason, this doesn't work with c of length 48. | ||
// Works with 47 though. | ||
module top(input [46:0] c, output [47:0] out); | ||
assign out = 48'(48'(c) >> 17); | ||
endmodule | ||
|
||
// CHECK: module out(c, out); |
48 changes: 48 additions & 0 deletions
48
integration_tests/lakeroad/xilinx_ultrascale_plus_dsp_internal_shift_broken.v
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,48 @@ | ||
// RUN: outfile=$(mktemp) | ||
// RUN: (racket $LAKEROAD_DIR/bin/main.rkt \ | ||
// RUN: --solver bitwuzla \ | ||
// RUN: --verilog-module-filepath %s \ | ||
// RUN: --architecture xilinx-ultrascale-plus \ | ||
// RUN: --template dsp \ | ||
// RUN: --out-format verilog \ | ||
// RUN: --top-module-name top \ | ||
// RUN: --verilog-module-out-signal out:48 \ | ||
// RUN: --pipeline-depth 0 \ | ||
// RUN: --module-name out \ | ||
// RUN: --input-signal 'c:(port c 48):48' \ | ||
// RUN: --timeout 90 \ | ||
// RUN: || true) \ | ||
// RUN: > $outfile \ | ||
// RUN: 2>&1 | ||
// RUN: FileCheck %s < $outfile | ||
// if [ -z ${LAKEROAD_PRIVATE_DIR+x} ]; then \ | ||
// echo "Warning: LAKEROAD_PRIVATE_DIR is not set. Skipping simulation."; \ | ||
// exit 0; \ | ||
// else \ | ||
// python3 $LAKEROAD_DIR/bin/simulate_with_verilator.py \ | ||
// --test_module_name out \ | ||
// --ground_truth_module_name top \ | ||
// --max_num_tests=10000 \ | ||
// --verilog_filepath $outfile \ | ||
// --verilog_filepath %s \ | ||
// --pipeline_depth 0 \ | ||
// --output_signal out:48 \ | ||
// --input_signal c:47 \ | ||
// --verilator_include_dir "$LAKEROAD_PRIVATE_DIR/DSP48E2/" \ | ||
// --verilator_extra_arg='-DXIL_XECLIB' \ | ||
// --verilator_extra_arg='-Wno-UNOPTFLAT' \ | ||
// --verilator_extra_arg='-Wno-LATCH' \ | ||
// --verilator_extra_arg='-Wno-WIDTH' \ | ||
// --verilator_extra_arg='-Wno-STMTDLY' \ | ||
// --verilator_extra_arg='-Wno-CASEX' \ | ||
// --verilator_extra_arg='-Wno-TIMESCALEMOD' \ | ||
// --verilator_extra_arg='-Wno-PINMISSING'; \ | ||
// fi | ||
|
||
// TODO(@gussmith23): For some reason, this doesn't work with c of length 48. | ||
// Works with 47 though. | ||
module top(input [47:0] c, output [47:0] out); | ||
assign out = 48'(48'(c) >> 17); | ||
endmodule | ||
|
||
// CHECK: Synthesis failed |
51 changes: 51 additions & 0 deletions
51
...tion_tests/lakeroad/xilinx_ultrascale_plus_dsp_internal_shift_explicit_arithmetic_shift.v
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,51 @@ | ||
// RUN: outfile=$(mktemp) | ||
// RUN: racket $LAKEROAD_DIR/bin/main.rkt \ | ||
// RUN: --solver bitwuzla \ | ||
// RUN: --verilog-module-filepath %s \ | ||
// RUN: --architecture xilinx-ultrascale-plus \ | ||
// RUN: --template dsp \ | ||
// RUN: --out-format verilog \ | ||
// RUN: --top-module-name top \ | ||
// RUN: --verilog-module-out-signal out:48 \ | ||
// RUN: --pipeline-depth 0 \ | ||
// RUN: --module-name out \ | ||
// RUN: --input-signal 'c:(port c 48):48' \ | ||
// RUN: --timeout 90 \ | ||
// RUN: > $outfile | ||
// RUN: FileCheck %s < $outfile | ||
// RUN: if [ -z ${LAKEROAD_PRIVATE_DIR+x} ]; then \ | ||
// RUN: echo "Warning: LAKEROAD_PRIVATE_DIR is not set. Skipping simulation."; \ | ||
// RUN: exit 0; \ | ||
// RUN: else \ | ||
// RUN: python3 $LAKEROAD_DIR/bin/simulate_with_verilator.py \ | ||
// RUN: --test_module_name out \ | ||
// RUN: --ground_truth_module_name top \ | ||
// RUN: --max_num_tests=10000 \ | ||
// RUN: --verilog_filepath $outfile \ | ||
// RUN: --verilog_filepath %s \ | ||
// RUN: --pipeline_depth 0 \ | ||
// RUN: --output_signal out:48 \ | ||
// RUN: --input_signal c:48 \ | ||
// RUN: --verilator_include_dir "$LAKEROAD_PRIVATE_DIR/DSP48E2/" \ | ||
// RUN: --verilator_extra_arg='-DXIL_XECLIB' \ | ||
// RUN: --verilator_extra_arg='-Wno-UNOPTFLAT' \ | ||
// RUN: --verilator_extra_arg='-Wno-LATCH' \ | ||
// RUN: --verilator_extra_arg='-Wno-WIDTH' \ | ||
// RUN: --verilator_extra_arg='-Wno-STMTDLY' \ | ||
// RUN: --verilator_extra_arg='-Wno-CASEX' \ | ||
// RUN: --verilator_extra_arg='-Wno-TIMESCALEMOD' \ | ||
// RUN: --verilator_extra_arg='-Wno-PINMISSING'; \ | ||
// RUN: fi | ||
|
||
// TODO(@gussmith23): here, I explicitly do a signed shift, which does | ||
// synthesize. I assumed >> did a signed shift when the arguments are signed, | ||
// but perhaps I'm wrong. Why does this matter? Because it means we need to be | ||
// careful about how we do our rewriting in the egraph. We can't necessarily | ||
// just rewrite to a >> in the egraph without fully understanding the semantics. | ||
// So the task here is to understand how we should be writing the shift | ||
// in a partial-product multiply-splitting scenario. | ||
module top(input [47:0] c, output [47:0] out); | ||
assign out = {{17{c[47]}}, c[47:17]}; | ||
endmodule | ||
|
||
// CHECK: module out(c, out); |
49 changes: 49 additions & 0 deletions
49
integration_tests/lakeroad/xilinx_ultrascale_plus_mac_with_internal_shift.v
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,49 @@ | ||
// RUN: outfile=$(mktemp) | ||
// RUN: racket $LAKEROAD_DIR/bin/main.rkt \ | ||
// RUN: --solver cvc5 \ | ||
// RUN: --verilog-module-filepath %s \ | ||
// RUN: --architecture xilinx-ultrascale-plus \ | ||
// RUN: --template dsp \ | ||
// RUN: --out-format verilog \ | ||
// RUN: --top-module-name top \ | ||
// RUN: --verilog-module-out-signal out:48 \ | ||
// RUN: --pipeline-depth 0 \ | ||
// RUN: --module-name out \ | ||
// RUN: --input-signal 'a:(port a 16):16' \ | ||
// RUN: --input-signal 'b:(port b 16):16' \ | ||
// RUN: --input-signal 'c:(port c 48):48' \ | ||
// RUN: --timeout 90 \ | ||
// RUN: > $outfile | ||
// RUN: FileCheck %s < $outfile | ||
// RUN: if [ -z ${LAKEROAD_PRIVATE_DIR+x} ]; then \ | ||
// RUN: echo "Warning: LAKEROAD_PRIVATE_DIR is not set. Skipping simulation."; \ | ||
// RUN: exit 0; \ | ||
// RUN: else \ | ||
// RUN: python3 $LAKEROAD_DIR/bin/simulate_with_verilator.py \ | ||
// RUN: --test_module_name out \ | ||
// RUN: --ground_truth_module_name top \ | ||
// RUN: --max_num_tests=10000 \ | ||
// RUN: --verilog_filepath $outfile \ | ||
// RUN: --verilog_filepath %s \ | ||
// RUN: --pipeline_depth 0 \ | ||
// RUN: --output_signal out:48 \ | ||
// RUN: --input_signal a:30 \ | ||
// RUN: --input_signal b:18 \ | ||
// RUN: --input_signal c:48 \ | ||
// RUN: --verilator_include_dir "$LAKEROAD_PRIVATE_DIR/DSP48E2/" \ | ||
// RUN: --verilator_extra_arg='-DXIL_XECLIB' \ | ||
// RUN: --verilator_extra_arg='-Wno-UNOPTFLAT' \ | ||
// RUN: --verilator_extra_arg='-Wno-LATCH' \ | ||
// RUN: --verilator_extra_arg='-Wno-WIDTH' \ | ||
// RUN: --verilator_extra_arg='-Wno-STMTDLY' \ | ||
// RUN: --verilator_extra_arg='-Wno-CASEX' \ | ||
// RUN: --verilator_extra_arg='-Wno-TIMESCALEMOD' \ | ||
// RUN: --verilator_extra_arg='-Wno-PINMISSING'; \ | ||
// RUN: fi | ||
|
||
module top(input [15:0] a, input [15:0] b, input [47:0] c, output [47:0] out); | ||
logic [31:0] mul_result = a * b; | ||
assign out = mul_result + {{17{c[47]}}, c[47:17]}; | ||
endmodule | ||
|
||
// CHECK: module out(a, b, c, out); |