@@ -104,38 +104,48 @@ class WbInterconOneMasterSpec extends AnyFlatSpec with Matchers {
104
104
105
105
it should " raise the err_i line of the master if read address is unmapped" in {
106
106
val dataWidth = 16
107
- val wbm = new WbMaster (dataWidth, 3 , " Spi2WbMaster" , feature_err= true )
107
+ val wbm = new WbMaster (dataWidth, 7 , " Spi2WbMaster" , feature_err= true )
108
108
val wbs1 = new WbSlave (dataWidth, 2 , " Ksz1" )
109
+ val wbs2 = new WbSlave (dataWidth, 2 , " Ksz2" )
109
110
110
- simulate(new WbInterconOneMaster (wbm, Seq (wbs1))) { dut =>
111
+ simulate(new WbInterconOneMaster (wbm, Seq (wbs1, wbs2 ))) { dut =>
111
112
dut.io.wbm.err_i.get.expect(false .B , " bad init of err_i" )
112
113
113
114
// Read on unmapped address
114
- dut.io.wbm.adr_o.poke(0x4 )
115
+ dut.io.wbm.adr_o.poke(0x8 )
115
116
dut.io.wbm.we_o.poke(false .B )
116
117
dut.io.wbm.cyc_o.poke(true .B )
117
118
dut.io.wbm.stb_o.poke(true .B )
118
119
dut.clock.step(1 )
119
- dut.io.wbm.err_i.get.expect(true .B , " err_i not raised" )
120
+ dut.io.wbm.err_i.get.expect(true .B , " err_i not raised on unmapped address read " )
120
121
121
122
// Stop transaction
122
123
dut.io.wbm.cyc_o.poke(false .B )
123
124
dut.io.wbm.stb_o.poke(false .B )
124
125
dut.clock.step(1 )
125
126
dut.io.wbm.err_i.get.expect(false .B , " err_i not resetted correctly" )
127
+
128
+ // Read on mapped address
129
+ dut.io.wbm.adr_o.poke(0x0 )
130
+ dut.io.wbm.we_o.poke(false .B )
131
+ dut.io.wbm.cyc_o.poke(true .B )
132
+ dut.io.wbm.stb_o.poke(true .B )
133
+ dut.clock.step(1 )
134
+ dut.io.wbm.err_i.get.expect(false .B , " err_i raised on mapped address read" )
126
135
}
127
136
}
128
137
129
138
it should " raise the err_i line of the master if write address is unmapped" in {
130
139
val dataWidth = 16
131
- val wbm = new WbMaster (dataWidth, 3 , " Spi2WbMaster" , feature_err= true )
140
+ val wbm = new WbMaster (dataWidth, 7 , " Spi2WbMaster" , feature_err= true )
132
141
val wbs1 = new WbSlave (dataWidth, 2 , " Ksz1" )
142
+ val wbs2 = new WbSlave (dataWidth, 2 , " Ksz2" )
133
143
134
- simulate(new WbInterconOneMaster (wbm, Seq (wbs1))) { dut =>
144
+ simulate(new WbInterconOneMaster (wbm, Seq (wbs1, wbs2 ))) { dut =>
135
145
dut.io.wbm.err_i.get.expect(false .B , " bad init of err_i" )
136
146
137
147
// Write on unmapped address
138
- dut.io.wbm.adr_o.poke(0x4 )
148
+ dut.io.wbm.adr_o.poke(0x8 )
139
149
dut.io.wbm.we_o.poke(true .B )
140
150
dut.io.wbm.cyc_o.poke(true .B )
141
151
dut.io.wbm.stb_o.poke(true .B )
@@ -148,6 +158,14 @@ class WbInterconOneMasterSpec extends AnyFlatSpec with Matchers {
148
158
dut.io.wbm.stb_o.poke(false .B )
149
159
dut.clock.step(1 )
150
160
dut.io.wbm.err_i.get.expect(false .B , " err_i not resetted correctly" )
161
+
162
+ // Write on mapped address
163
+ dut.io.wbm.adr_o.poke(0x0 )
164
+ dut.io.wbm.we_o.poke(true .B )
165
+ dut.io.wbm.cyc_o.poke(true .B )
166
+ dut.io.wbm.stb_o.poke(true .B )
167
+ dut.clock.step(1 )
168
+ dut.io.wbm.err_i.get.expect(false .B , " err_i raised on mapped address write" )
151
169
}
152
170
}
153
171
0 commit comments