Skip to content

Commit

Permalink
[NFC] Split test for each tool
Browse files Browse the repository at this point in the history
  • Loading branch information
darthscsi committed Oct 28, 2021
1 parent 6a45ada commit bbdcddd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: verilator, questa
// REQUIRES: verilator

// RUN: firtool --lower-to-hw --verilog %s > %t1.1995.v
// RUN: firtool --lower-to-hw --verilog %s > %t1.2001.v
Expand All @@ -16,20 +16,12 @@
// RUN: verilator --lint-only +1800-2012ext+sv %t1.2012.sv
// RUN: verilator --lint-only +1800-2017ext+sv %t1.2017.sv

// RUN: vlog -lint %t1.1995.v -vlog95compat || true
// RUN: vlog -lint %t1.2001.v -vlog01compat || true
// RUN: vlog -lint %t1.2005.v || true
// RUN: vlog -lint -sv -sv05compat %t1.2005.sv
// RUN: vlog -lint -sv -sv09compat %t1.2009.sv
// RUN: vlog -lint -sv -sv12compat %t1.2012.sv
// RUN: vlog -lint -sv -sv17compat %t1.2017.sv

hw.module @top(%clock : i1, %reset: i1,
%a: i4,
%s: !hw.struct<foo: i2, bar: i4>,
%parray: !hw.array<10xi4>,
%uarray: !hw.uarray<16xi8>
) -> (%r0: i4, %r1: i4) {
%uarray: !hw.uarray<16xi8>)
-> (r0: i4, r1: i4) {
%0 = comb.or %a, %a : i4
%1 = comb.and %a, %a : i4

Expand Down
36 changes: 36 additions & 0 deletions integration_test/EmitVerilog/standards-vlog.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// REQUIRES: questa

// RUN: firtool --lower-to-hw --verilog %s > %t1.1995.v
// RUN: firtool --lower-to-hw --verilog %s > %t1.2001.v
// RUN: firtool --lower-to-hw --verilog %s > %t1.2005.v
// RUN: firtool --lower-to-hw --verilog %s > %t1.2005.sv
// RUN: firtool --lower-to-hw --verilog %s > %t1.2009.sv
// RUN: firtool --lower-to-hw --verilog %s > %t1.2012.sv
// RUN: firtool --lower-to-hw --verilog %s> %t1.2017.sv

// RUN: vlog -lint %t1.1995.v -vlog95compat || true
// RUN: vlog -lint %t1.2001.v -vlog01compat || true
// RUN: vlog -lint %t1.2005.v || true
// RUN: vlog -lint -sv -sv05compat %t1.2005.sv
// RUN: vlog -lint -sv -sv09compat %t1.2009.sv
// RUN: vlog -lint -sv -sv12compat %t1.2012.sv
// RUN: vlog -lint -sv -sv17compat %t1.2017.sv

hw.module @top(%clock : i1, %reset: i1,
%a: i4,
%s: !hw.struct<foo: i2, bar: i4>,
%parray: !hw.array<10xi4>,
%uarray: !hw.uarray<16xi8>)
-> (r0: i4, r1: i4) {
%0 = comb.or %a, %a : i4
%1 = comb.and %a, %a : i4

sv.always posedge %clock, negedge %reset {
}

sv.alwaysff(posedge %clock) {
sv.fwrite "Yo\n"
}

hw.output %0, %1 : i4, i4
}
2 changes: 1 addition & 1 deletion integration_test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
config.available_features.add('rtl-sim')
llvm_config.with_environment('VERILATOR_PATH', config.verilator_path)

# Enable Questa if it has been detected.
# Enable Quartus if it has been detected.
if config.quartus_path != "":
tool_dirs.append(os.path.dirname(config.quartus_path))
tools.append('quartus')
Expand Down

0 comments on commit bbdcddd

Please sign in to comment.