@@ -11,7 +11,7 @@ class PipeConRVTest() extends AnyFlatSpec with ChiselScalatestTester {
1111 behavior of " The CpuInterfaceRV"
1212
1313 it should " do something" in {
14- test(new PipeConRV (4 , UInt (32 .W ))) {
14+ test(new PipeConRV (4 , UInt (32 .W ))).withAnnotations( Seq ( WriteVcdAnnotation )) {
1515 d => {
1616
1717 def step () = d.clock.step()
@@ -25,6 +25,9 @@ class PipeConRVTest() extends AnyFlatSpec with ChiselScalatestTester {
2525 step()
2626 cp.ack.expect(false .B )
2727
28+ // useful default
29+ cp.wrMask.poke(0xf .U )
30+
2831 // two cycle write into tx register
2932 // TODO: should be a single cycle operation when the tx channel is ready
3033 cp.address.poke(4 .U )
@@ -67,12 +70,13 @@ class PipeConRVTest() extends AnyFlatSpec with ChiselScalatestTester {
6770 assert(helper.read(0 ) == 2 )
6871 tx.ready.poke(true .B )
6972 assert(helper.read(0 ) == 3 )
73+ step()
7074
71- helper.write(0 , 0xcafe )
75+ helper.write(4 , 0xcafe )
7276 tx.bits.expect(0xcafe )
7377
7478 rx.bits.poke(123 )
75- assert(helper.read(1 ) == 123 )
79+ assert(helper.read(4 ) == 123 )
7680 }
7781 }
7882 }
@@ -92,11 +96,11 @@ class PipeConRVTest() extends AnyFlatSpec with ChiselScalatestTester {
9296 val helper = new MemoryMappedIOHelper (d.cpuPort, d.clock)
9397
9498 // should get back the data at some time
95- helper.write(1 , 0x1234 )
99+ helper.write(4 , 0x1234 )
96100 var ok = false
97101 for (i <- 0 until 10 if ! ok) {
98102 if (helper.rxAvail) {
99- assert(helper.read(1 ) == 0x1234 )
103+ assert(helper.read(4 ) == 0x1234 )
100104 ok = true
101105 }
102106 }
@@ -204,8 +208,8 @@ class PipeConRVTest() extends AnyFlatSpec with ChiselScalatestTester {
204208 cpif.rx <> fifo.io.deq
205209 }
206210
207- it should " do work with a S4NOC Entry" in {
208- test(new MyModule3 ()).withAnnotations( Seq ( WriteVcdAnnotation )) {
211+ it should " work with a S4NOC Entry" in {
212+ test(new MyModule3 ()) {
209213 d => {
210214 val helper = new MemoryMappedIOHelper (d.cpuPort, d.clock)
211215
0 commit comments