Skip to content

Commit 9eddbac

Browse files
committed
chore: restore tests
1 parent 29c7a8c commit 9eddbac

File tree

5 files changed

+77
-9
lines changed

5 files changed

+77
-9
lines changed

test/Conversion/ImportVerilog/basic.sv

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,10 +3254,10 @@ function void StructCreateConversion (logic [7:0][7:0] array, logic [63:0] immed
32543254
} testStruct;
32553255

32563256
// CHECK: [[TS:%.+]] = moore.struct_create [[IMM]] : !moore.l64 -> struct<{structField: l64}>
3257-
testStruct ts = '{structField: immediate};
3257+
automatic testStruct ts = '{structField: immediate};
32583258
// CHECK: [[CAST:%.+]] = moore.packed_to_sbv [[ARRAY]] : array<8 x l8>
32593259
// CHECK-NEXT: [[TS2:%.+]] = moore.struct_create [[CAST]] : !moore.l64 -> struct<{structField: l64}>
3260-
testStruct ts2 = '{structField: array};
3260+
automatic testStruct ts2 = '{structField: array};
32613261

32623262
endfunction
32633263

@@ -3845,3 +3845,7 @@ module implicitCastsFunctionArguments;
38453845
fn(q, r);
38463846
end
38473847
endmodule
3848+
3849+
// CHECK-LABEL: moore.module @ProgramsAreMostlyModules
3850+
program ProgramsAreMostlyModules;
3851+
endprogram

test/Conversion/MooreToCore/basic.mlir

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,4 +1412,12 @@ func.func @RealToIntLowering(%arg0: !moore.f32, %arg1: !moore.f64) {
14121412
%0 = moore.real_to_int %arg0 : f32 -> i42
14131413
%1 = moore.real_to_int %arg1 : f64 -> i42
14141414
return
1415-
}
1415+
}
1416+
1417+
// CHECK-LABEL: func.func @CurrentTime
1418+
func.func @CurrentTime() -> !moore.time {
1419+
// CHECK-NEXT: [[TMP:%.+]] = llhd.current_time
1420+
%0 = moore.builtin.time
1421+
// CHECK-NEXT: return [[TMP]] : !llhd.time
1422+
return %0 : !moore.time
1423+
}

test/Dialect/FIRRTL/errors.mlir

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,6 +3043,17 @@ firrtl.circuit "DomainInfoNotArray" {
30433043

30443044
// -----
30453045

3046+
firrtl.circuit "DomainInfoWrongSize" {
3047+
firrtl.domain @ClockDomain
3048+
// expected-error @below {{requires 2 port domains, but has 1}}
3049+
firrtl.module @WrongDomainPortInfo(
3050+
in %A: !firrtl.domain of @ClockDomain,
3051+
in %a: !firrtl.uint<1>
3052+
) attributes {domainInfo = [@ClockDomain]} {}
3053+
}
3054+
3055+
// -----
3056+
30463057
firrtl.circuit "WrongDomainPortInfo" {
30473058
firrtl.domain @ClockDomain
30483059
// expected-error @below {{domain information for domain port 'A' must be a 'FlatSymbolRefAttr'}}
@@ -3053,16 +3064,46 @@ firrtl.circuit "WrongDomainPortInfo" {
30533064

30543065
// -----
30553066

3056-
firrtl.circuit "WrongNonDomainPortInfo" {
3067+
firrtl.circuit "WrongNonDomainPortInfoType" {
3068+
firrtl.domain @ClockDomain
3069+
// expected-error @below {{domain information for non-domain port 'a' must be an 'ArrayAttr'}}
3070+
firrtl.module @WrongNonDomainPortInfoType(
3071+
in %a: !firrtl.uint<1>
3072+
) attributes {domainInfo = ["hello"]} {}
3073+
}
3074+
3075+
// -----
3076+
3077+
firrtl.circuit "WrongNonDomainPortInfoElementType" {
30573078
firrtl.domain @ClockDomain
30583079
// expected-error @below {{domain information for non-domain port 'a' must be an 'ArrayAttr<IntegerAttr>'}}
3059-
firrtl.module @WrongNonDomainPortInfo(
3080+
firrtl.module @WrongNonDomainPortInfoElementType(
30603081
in %a: !firrtl.uint<1>
30613082
) attributes {domainInfo = [["hello"]]} {}
30623083
}
30633084

30643085
// -----
30653086

3087+
firrtl.circuit "DomainAssociationOOB" {
3088+
firrtl.domain @ClockDomain
3089+
// expected-error @below {{has domain association 1 for port 'a', but the module only has 1 ports}}
3090+
firrtl.module @DomainAssociationOOB(
3091+
in %a: !firrtl.uint<1>
3092+
) attributes {domainInfo = [[1 : i32]]} {}
3093+
}
3094+
3095+
// -----
3096+
3097+
firrtl.circuit "DomainAssociationOOB" {
3098+
firrtl.domain @ClockDomain
3099+
// expected-error @below {{has port 'a' which has a domain association with non-domain port 'a'}}
3100+
firrtl.module @DomainAssociationOOB(
3101+
in %a: !firrtl.uint<1>
3102+
) attributes {domainInfo = [[0 : i32]]} {}
3103+
}
3104+
3105+
// -----
3106+
30663107
// Output domain ports on modules can only be driven once.
30673108

30683109
firrtl.circuit "Top" {

test/Dialect/FIRRTL/infer-widths.mlir

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,15 @@ firrtl.circuit "Foo" {
435435
firrtl.connect %ui, %c0_ui5 : !firrtl.uint, !firrtl.uint<5>
436436
}
437437

438+
firrtl.domain @ClockDomain
439+
438440
// CHECK-LABEL: @TransparentOps
439-
firrtl.module @TransparentOps(in %clk: !firrtl.clock, in %a: !firrtl.uint<1>) {
441+
firrtl.module @TransparentOps(
442+
in %clk: !firrtl.clock,
443+
in %a: !firrtl.uint<1>,
444+
in %A: !firrtl.domain of @ClockDomain,
445+
out %B: !firrtl.domain of @ClockDomain
446+
) {
440447
%false = firrtl.constant 0 : !firrtl.uint<1>
441448
%true = firrtl.constant 1 : !firrtl.uint<1>
442449
%c0_ui4 = firrtl.constant 0 : !firrtl.uint<4>
@@ -457,6 +464,7 @@ firrtl.circuit "Foo" {
457464
firrtl.assume %clk, %true, %true, "foo" : !firrtl.clock, !firrtl.uint<1>, !firrtl.uint<1>
458465
firrtl.int.unclocked_assume %true, %true, "foo" : !firrtl.uint<1>, !firrtl.uint<1>
459466
firrtl.cover %clk, %true, %true, "foo" : !firrtl.clock, !firrtl.uint<1>, !firrtl.uint<1>
467+
firrtl.domain.define %B, %A
460468
}
461469

462470
// Issue #1088
@@ -859,7 +867,7 @@ firrtl.circuit "Foo" {
859867

860868
%c0_ui2 = firrtl.constant 0 : !firrtl.uint<2>
861869
firrtl.connect %w, %c0_ui2 : !firrtl.uint, !firrtl.uint<2>
862-
870+
863871
%bov_a = firrtl.subfield %bov[a] : !firrtl.bundle<a: vector<uint, 2>, b flip: uint>
864872
%bov_a_1 = firrtl.subindex %bov_a[1] : !firrtl.vector<uint, 2>
865873
%bov_b = firrtl.subfield %bov[b] : !firrtl.bundle<a: vector<uint, 2>, b flip: uint>
@@ -914,7 +922,7 @@ firrtl.circuit "Foo" {
914922
%0 = firrtl.subfield %invalid[a] : !firrtl.bundle<a: vector<uint, 2>>
915923
%1 = firrtl.subindex %0[0] : !firrtl.vector<uint, 2>
916924
}
917-
925+
918926
// CHECK-LABEL: @InferConst
919927
// CHECK-SAME: out %out: !firrtl.const.bundle<a: uint<1>, b: sint<2>, c: analog<3>, d: vector<uint<4>, 2>>
920928
firrtl.module @InferConst(in %a: !firrtl.const.uint<1>, in %b: !firrtl.const.sint<2>, in %c: !firrtl.const.analog<3>, in %d: !firrtl.const.vector<uint<4>, 2>,
@@ -929,7 +937,7 @@ firrtl.circuit "Foo" {
929937
firrtl.attach %2, %c : !firrtl.const.analog, !firrtl.const.analog<3>
930938
firrtl.connect %3, %d : !firrtl.const.vector<uint, 2>, !firrtl.const.vector<uint<4>, 2>
931939
}
932-
940+
933941
// Should not crash when encountering property types.
934942
// CHECK: firrtl.module @Property(in %a: !firrtl.string)
935943
firrtl.module @Property(in %a: !firrtl.string) { }

test/Dialect/LLHD/IR/basic.mlir

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,10 @@ hw.module @CombinationalProcess(in %arg0: i1, in %arg1: i42, in %arg2: i9001, in
197197
llhd.yield %1, %2 : i42, i9001
198198
}
199199
}
200+
201+
// CHECK-LABEL: @CurrentTime
202+
func.func @CurrentTime() -> !llhd.time {
203+
// CHECK: llhd.current_time
204+
%0 = llhd.current_time
205+
return %0 : !llhd.time
206+
}

0 commit comments

Comments
 (0)