Line 4... |
Line 4... |
//// ////
|
//// ////
|
//// Description ////
|
//// Description ////
|
//// ORPSoC Testbench file ////
|
//// ORPSoC Testbench file ////
|
//// ////
|
//// ////
|
//// To Do: ////
|
//// To Do: ////
|
|
//// Somehow allow tracing to begin later in the sim ////
|
//// ////
|
//// ////
|
//// ////
|
//// ////
|
//// Author(s): ////
|
//// Author(s): ////
|
//// - Jeremy Bennett jeremy.bennett@embecosm.com ////
|
//// - Jeremy Bennett jeremy.bennett@embecosm.com ////
|
//// - Julius Baxter jb@orsoc.se ////
|
//// - Julius Baxter jb@orsoc.se ////
|
Line 51... |
Line 52... |
|
|
|
|
int sc_main (int argc,
|
int sc_main (int argc,
|
char *argv[] )
|
char *argv[] )
|
{
|
{
|
|
|
// CPU clock (also used as JTAG TCK) and reset (both active high and low)
|
// CPU clock (also used as JTAG TCK) and reset (both active high and low)
|
sc_time clkPeriod (BENCH_CLK_HALFPERIOD * 2.0, TIMESCALE_UNIT);
|
sc_time clkPeriod (BENCH_CLK_HALFPERIOD * 2.0, TIMESCALE_UNIT);
|
|
|
sc_clock clk ("clk", clkPeriod);
|
sc_clock clk ("clk", clkPeriod);
|
sc_signal<bool> rst;
|
sc_signal<bool> rst;
|
Line 93... |
Line 95... |
Or1200MonitorSC *monitor; // Handle l.nop x instructions
|
Or1200MonitorSC *monitor; // Handle l.nop x instructions
|
UartSC *uart; // Handle UART signals
|
UartSC *uart; // Handle UART signals
|
|
|
// Instantiate the Verilator model, VCD trace handler and accessor
|
// Instantiate the Verilator model, VCD trace handler and accessor
|
orpsoc = new Vorpsoc_top ("orpsoc");
|
orpsoc = new Vorpsoc_top ("orpsoc");
|
trace = new TraceSC ("trace", orpsoc, "v-dump.vcd");
|
trace = new TraceSC ("trace", orpsoc, argc, argv);
|
accessor = new OrpsocAccess (orpsoc);
|
accessor = new OrpsocAccess (orpsoc);
|
|
|
// Instantiate the SystemC modules
|
// Instantiate the SystemC modules
|
reset = new ResetSC ("reset", BENCH_RESET_TIME);
|
reset = new ResetSC ("reset", BENCH_RESET_TIME);
|
monitor = new Or1200MonitorSC ("monitor", accessor);
|
monitor = new Or1200MonitorSC ("monitor", accessor);
|