Line 45... |
Line 45... |
#include "Vorpsoc_top.h"
|
#include "Vorpsoc_top.h"
|
#include "OrpsocAccess.h"
|
#include "OrpsocAccess.h"
|
#include "TraceSC.h"
|
#include "TraceSC.h"
|
#include "ResetSC.h"
|
#include "ResetSC.h"
|
#include "Or1200MonitorSC.h"
|
#include "Or1200MonitorSC.h"
|
|
#include "UartSC.h"
|
|
|
|
|
int sc_main (int argc,
|
int sc_main (int argc,
|
char *argv[] )
|
char *argv[] )
|
{
|
{
|
Line 88... |
Line 89... |
Vorpsoc_top *orpsoc; // Verilated ORPSoC
|
Vorpsoc_top *orpsoc; // Verilated ORPSoC
|
TraceSC *trace; // Drive VCD
|
TraceSC *trace; // Drive VCD
|
|
|
ResetSC *reset; // Generate a RESET signal
|
ResetSC *reset; // Generate a RESET signal
|
Or1200MonitorSC *monitor; // Handle l.nop x instructions
|
Or1200MonitorSC *monitor; // Handle l.nop x instructions
|
|
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, "v-dump.vcd");
|
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);
|
|
uart = new UartSC("uart"); // TODO: Probalby some sort of param
|
|
|
// Connect up ORPSoC
|
// Connect up ORPSoC
|
orpsoc->clk_pad_i (clk);
|
orpsoc->clk_pad_i (clk);
|
orpsoc->rst_pad_i (rstn);
|
orpsoc->rst_pad_i (rstn);
|
orpsoc->rst_pad_o (rst_o);
|
orpsoc->rst_pad_o (rst_o);
|
Line 136... |
Line 139... |
reset->rst (rst);
|
reset->rst (rst);
|
reset->rstn (rstn);
|
reset->rstn (rstn);
|
|
|
monitor->clk (clk); // Monitor
|
monitor->clk (clk); // Monitor
|
|
|
|
uart->clk (clk); // Uart
|
|
uart->uartrx (uart_rx); // orpsoc's receive line
|
|
uart->uarttx (uart_tx); // orpsoc's transmit line
|
|
|
// Tie off signals
|
// Tie off signals
|
jtag_tdi = 1; // Tie off the JTAG inputs
|
jtag_tdi = 1; // Tie off the JTAG inputs
|
jtag_tms = 1;
|
jtag_tms = 1;
|
|
|
uart_rx = 1; // Tie off the UART
|
|
|
|
spi_sd_miso = 0; // Tie off master-in/slave-out of SD SPI bus
|
spi_sd_miso = 0; // Tie off master-in/slave-out of SD SPI bus
|
|
|
spi1_miso = 0;
|
spi1_miso = 0;
|
|
|
printf("Beginning test\n");
|
printf("Beginning test\n");
|
|
|
|
// Init the UART function
|
|
uart->initUart(10000000, 115200);
|
|
|
// Execute until we stop
|
// Execute until we stop
|
sc_start ();
|
sc_start ();
|
|
|
// Free memory
|
// Free memory
|
delete monitor;
|
delete monitor;
|