1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| 实例1 val tiRomStartAddr = Wire(UInt()) when (io.swif.K<40.U ){tiRomStartAddr := 25.U } .elsewhen (io.swif.K<159.U ){tiRomStartAddr := 21.U } .elsewhen (io.swif.K<200.U ){tiRomStartAddr := 35.U } .elsewhen (io.swif.K<481.U ){tiRomStartAddr := 15.U } .elsewhen (io.swif.K<530.U ){tiRomStartAddr := 10.U } .elsewhen (io.swif.K<2881.U){tiRomStartAddr := 5.U } .otherwise {tiRomStartAddr := 25.U }
实例2 val RRomRdata = Wire(UInt()) RRomRdata := 0.U switch (io.RRomAddr) { is (0.U) {RRomRdata := intraRowTi.RRomVal(0).U} is (1.U) {RRomRdata := intraRowTi.RRomVal(1).U} is (2.U) {RRomRdata := intraRowTi.RRomVal(2).U} is (3.U) {RRomRdata := intraRowTi.RRomVal(3).U} is (4.U) {RRomRdata := intraRowTi.RRomVal(4).U} is (5.U) {RRomRdata := intraRowTi.RRomVal(5).U} is (6.U) {RRomRdata := intraRowTi.RRomVal(6).U} is (7.U) {RRomRdata := intraRowTi.RRomVal(7).U} }
实例3 val PrimeRom = Vec(PrimeAndRoot.map(_.U)) io.out3 := PrimeRom(io.i)
|