From 3aa4ca17d43a0bf752365efce5e68bbbdc6a4764 Mon Sep 17 00:00:00 2001 From: RuigeLee Date: Fri, 28 Jul 2023 20:42:35 +0800 Subject: [PATCH] all test pass --- src/main/scala/backBoard/CDROutBus.scala | 10 +++++----- tb/sim_backSlv.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/scala/backBoard/CDROutBus.scala b/src/main/scala/backBoard/CDROutBus.scala index eb4f571..729d30a 100644 --- a/src/main/scala/backBoard/CDROutBus.scala +++ b/src/main/scala/backBoard/CDROutBus.scala @@ -43,18 +43,18 @@ class CDROutBus extends Module{ - when( cnt === 0.U ){ + when( cnt === 1.U ){ io.dat := true.B - } .elsewhen( cnt >= (0 + 1).U && cnt < (6 + 1).U ){ + } .elsewhen( cnt >= (1 + 1).U && cnt < (6 + 1 + 1).U ){ io.dat := address(5) address := address << 1 - } .elsewhen( cnt >= (0 + 1 + 6).U && cnt < (8 + 1 + 6).U ){ + } .elsewhen( cnt >= (1 + 1 + 6).U && cnt < (8 + 1+ 1 + 6).U ){ io.dat := register(7) register := register << 1 - } .elsewhen( cnt >= (0 + 1 + 6 + 8).U && cnt < (32 + 1 + 6 + 8).U ){ + } .elsewhen( cnt >= (1 + 1 + 6 + 8).U && cnt < (32 + 1 + 1 + 6 + 8).U ){ io.dat := data(31) data := data << 1 - } .elsewhen( cnt >= (0 + 1 + 6 + 8 + 32).U && cnt < (16 + 1 + 6 + 8 + 32).U ){ + } .elsewhen( cnt >= (1 + 1 + 6 + 8 + 32).U && cnt < (16 + 1 + 1 + 6 + 8 + 32).U ){ io.dat := hash(15) hash := hash << 1 } .otherwise{ diff --git a/tb/sim_backSlv.cpp b/tb/sim_backSlv.cpp index da2fa8f..4e28092 100644 --- a/tb/sim_backSlv.cpp +++ b/tb/sim_backSlv.cpp @@ -101,19 +101,19 @@ int main(int argc, char **argv, char **env) { if( main_time == 50000 ){ top->io_req_valid = 1; - top->io_req_bits_address = 0x12; + top->io_req_bits_address = 0x11 << 1 | 0x00; top->io_req_bits_register = 0x0; top->io_req_bits_data = 0xaa; } else if( main_time == 50400 ){ top->io_req_valid = 0; } - if( main_time == 100000 ){ + if( main_time == 150000 ){ top->io_rsp_valid = 1; - top->io_rsp_bits_address = 0x12; + top->io_rsp_bits_address = 0x11 << 1 | 0x00; top->io_rsp_bits_register = 0x0; top->io_rsp_bits_data = 0xaa; - } else if( main_time == 100400 ){ + } else if( main_time == 150400 ){ top->io_rsp_valid = 0; } @@ -127,7 +127,7 @@ int main(int argc, char **argv, char **env) { main_time ++; - if( main_time > 200000 ){ + if( main_time > 250000 ){ break; } }