ParaNut SystemC Model
A SystemC Model of the ParaNut architecture
Classes
Simulator

ParaNut simulation system and control. More...

Classes

class  MParaNutSystem
 Complete ParaNut System ready for simulation. More...
 

Constructor / Destructor...

 MParaNutSystem::MParaNutSystem (const int argc, char *argv[])
 Create and elablorate the System. More...
 
 MParaNutSystem::~MParaNutSystem ()
 Destructor destroying all runtime objects. More...
 

System Construction...

void MParaNutSystem::AddSlave (TWord start_adr, size_t size, MPeripheral *slave)
 Add a slave peripheral to the ParaNut System. More...
 
void MParaNutSystem::AddInterrupt (TWord index, sc_out< bool > *port)
 Add a slave port to the ParaNut Systems internal interrupt input signals. More...
 
void MParaNutSystem::AddSlave (TWord start_adr, size_t size, sc_in_clk *wb_clk_i, sc_in< bool > *wb_rst_i, sc_in< bool > *wb_stb_i, sc_in< bool > *wb_cyc_i, sc_in< bool > *wb_we_i, sc_in< sc_uint< 3 > > *wb_cti_i, sc_in< sc_uint< 2 > > *wb_bte_i, sc_in< sc_uint< WB_PORT_SIZE/8 > > *wb_sel_i, sc_out< bool > *wb_ack_o, sc_out< bool > *wb_err_o, sc_out< bool > *wb_rty_o, sc_in< sc_uint< 32 > > *wb_adr_i, sc_in< sc_uint< WB_PORT_SIZE > > *wb_dat_i, sc_out< sc_uint< WB_PORT_SIZE > > *wb_dat_o)
 

Execution Control...

void MParaNutSystem::Run ()
 Start the SystemC simulation and wait for the ParaNut to HALT. More...
 

Support Functions...

void MParaNutSystem::Usage ()
 Print usage of the command line options to stdout. More...
 
void MParaNutSystem::PrintConfig ()
 Print the current configuration to stderr. More...
 

Detailed Description

ParaNut simulation system and control.

This module groups the simulation system and it's control functions.

A minimal SystemC main program to simulate a ParaNut system could look like this:

#include <systemc.h>
#include <paranut-sim.h>
int sc_main (int argc, char *argv[]) {
MParaNutSystem paranut (argc, argv);
paranut.Run ();
return 0;
}
Complete ParaNut System ready for simulation.
Definition: paranutsystem.h:84
int sc_main(int argc, char *argv[])
Definition: dm_tb.cpp:127

Function Documentation

◆ AddInterrupt()

void MParaNutSystem::AddInterrupt ( TWord  index,
sc_out< bool > *  port 
)

Add a slave port to the ParaNut Systems internal interrupt input signals.

The provided port will be bound to the interupt input at the given index.

Parameters
indexis the index of the interrupt input (must be < CFG_NUT_EX_INT).
portis the pointer of a sc_out<bool> port that will be bound.

◆ AddSlave() [1/2]

void MParaNutSystem::AddSlave ( TWord  start_adr,
size_t  size,
MPeripheral slave 
)
inline

Add a slave peripheral to the ParaNut System.

The provided slave peripheral will be added to the Wishbone interconnect at start_adr and will occupie size amount of bytes.

The interconnect checks for address space collisions and will stop execution on error.

NOTE: Calling with a non MPeripheral derived or compatible slave value will likely lead to unwanted behaviour or a segmentation fault!

Parameters
start_adris the I/O base address.
sizeis the number of bytes occupied by the slave.
slaveis a pointer to a MPeripheral derived or compatible module.

◆ AddSlave() [2/2]

void MParaNutSystem::AddSlave ( TWord  start_adr,
size_t  size,
sc_in_clk *  wb_clk_i,
sc_in< bool > *  wb_rst_i,
sc_in< bool > *  wb_stb_i,
sc_in< bool > *  wb_cyc_i,
sc_in< bool > *  wb_we_i,
sc_in< sc_uint< 3 > > *  wb_cti_i,
sc_in< sc_uint< 2 > > *  wb_bte_i,
sc_in< sc_uint< WB_PORT_SIZE/8 > > *  wb_sel_i,
sc_out< bool > *  wb_ack_o,
sc_out< bool > *  wb_err_o,
sc_out< bool > *  wb_rty_o,
sc_in< sc_uint< 32 > > *  wb_adr_i,
sc_in< sc_uint< WB_PORT_SIZE > > *  wb_dat_i,
sc_out< sc_uint< WB_PORT_SIZE > > *  wb_dat_o 
)
inline

◆ MParaNutSystem()

MParaNutSystem::MParaNutSystem ( const int  argc,
char *  argv[] 
)

Create and elablorate the System.

Parses the supplied argc and argv to configure the simulation and elaborates the System containing a ParaNut (MParanut), Wishbone interconnect (MInterconnect) and the Main Memory (MWBMemory).

Parameters
argcis the number of arguments in argv.
argvis the array of arguments that gets parsed.

◆ PrintConfig()

void MParaNutSystem::PrintConfig ( )

Print the current configuration to stderr.

Uses the PS_PRINTCAT and PS_PRINTCONF macros.

◆ Run()

void MParaNutSystem::Run ( )

Start the SystemC simulation and wait for the ParaNut to HALT.

Sets up and starts the debugging interfaces if the interactive debug flag is set (-d).

Prints performance statistics (-p), memory content befor and after completion (-m) and dumps signature section contents after completion (-s)

◆ Usage()

void MParaNutSystem::Usage ( )

Print usage of the command line options to stdout.

◆ ~MParaNutSystem()

MParaNutSystem::~MParaNutSystem ( )

Destructor destroying all runtime objects.