Skip to content

Commit

Permalink
[VTA][TSIM] Use Module instead of RawModule for testbench by creating…
Browse files Browse the repository at this point in the history
… an empty bundle for the IO (apache#3242)

* use Module instead of RawModule for testbench by creating an empty bundle for the IO

* change default back to verilog
  • Loading branch information
vegaluisjose authored and wweic committed Jun 27, 2019
1 parent d5d35ce commit 2560ae6
Showing 1 changed file with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package test

import chisel3._
import chisel3.experimental.{RawModule, withClockAndReset}
import vta.dpi._
import accel._

Expand All @@ -29,37 +28,30 @@ import accel._
* Instantiate Host and Memory DPI modules.
*
*/
class VTASimShell extends RawModule {
class VTASimShell extends Module {
val io = IO(new Bundle {
val clock = Input(Clock())
val reset = Input(Bool())
val host = new VTAHostDPIMaster
val mem = new VTAMemDPIClient
})
val host = Module(new VTAHostDPI)
val mem = Module(new VTAMemDPI)
mem.io.reset := io.reset
mem.io.clock := io.clock
host.io.reset := io.reset
host.io.clock := io.clock
io.mem <> mem.io.dpi
mem.io.dpi <> io.mem
mem.io.reset := reset
mem.io.clock := clock
io.host <> host.io.dpi
host.io.reset := reset
host.io.clock := clock
}

/** Test accelerator.
*
* Instantiate and connect the simulation-shell and the accelerator.
*
*/
class TestAccel extends RawModule {
val clock = IO(Input(Clock()))
val reset = IO(Input(Bool()))

class TestAccel extends Module {
val io = IO(new Bundle {})
val sim_shell = Module(new VTASimShell)
val vta_accel = withClockAndReset(clock, reset) { Module(new Accel) }

sim_shell.io.clock := clock
sim_shell.io.reset := reset
val vta_accel = Module(new Accel)
vta_accel.io.host <> sim_shell.io.host
sim_shell.io.mem <> vta_accel.io.mem
}
Expand Down

0 comments on commit 2560ae6

Please sign in to comment.