Line 37... |
Line 37... |
#include "Vorpsoc_top_or1200_ctrl.h"
|
#include "Vorpsoc_top_or1200_ctrl.h"
|
#include "Vorpsoc_top_or1200_except.h"
|
#include "Vorpsoc_top_or1200_except.h"
|
#include "Vorpsoc_top_or1200_sprs.h"
|
#include "Vorpsoc_top_or1200_sprs.h"
|
#include "Vorpsoc_top_or1200_rf.h"
|
#include "Vorpsoc_top_or1200_rf.h"
|
#include "Vorpsoc_top_or1200_dpram.h"
|
#include "Vorpsoc_top_or1200_dpram.h"
|
|
//#include "Vorpsoc_top_ram_wb.h"
|
|
//#include "Vorpsoc_top_ram_wb_sc_sw.h"
|
|
#include "Vorpsoc_top_ram_wb__D20_A18_M800000.h"
|
|
#include "Vorpsoc_top_ram_wb_sc_sw__D20_A18_M800000.h"
|
|
|
//! Constructor for the ORPSoC access class
|
//! Constructor for the ORPSoC access class
|
|
|
//! Initializes the pointers to the various module instances of interest
|
//! Initializes the pointers to the various module instances of interest
|
//! within the Verilator model.
|
//! within the Verilator model.
|
Line 51... |
Line 55... |
{
|
{
|
or1200_ctrl = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_ctrl;
|
or1200_ctrl = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_ctrl;
|
or1200_except = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_except;
|
or1200_except = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_except;
|
or1200_sprs = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_sprs;
|
or1200_sprs = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_sprs;
|
rf_a = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_rf->rf_a;
|
rf_a = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_rf->rf_a;
|
|
ram_wb_sc_sw = orpsoc_top->v->ram_wb0->ram0;
|
|
|
} // OrpsocAccess ()
|
} // OrpsocAccess ()
|
|
|
|
//! Access for the ex_freeze signal
|
|
|
|
//! @return The value of the or1200_ctrl.ex_freeze signal
|
|
|
|
bool
|
|
OrpsocAccess::getExFreeze ()
|
|
{
|
|
return or1200_ctrl->ex_freeze;
|
|
|
|
} // getExFreeze ()
|
|
|
//! Access for the wb_freeze signal
|
//! Access for the wb_freeze signal
|
|
|
//! @return The value of the or1200_ctrl.wb_freeze signal
|
//! @return The value of the or1200_ctrl.wb_freeze signal
|
|
|
Line 88... |
Line 103... |
{
|
{
|
return or1200_except->ex_dslot;
|
return or1200_except->ex_dslot;
|
|
|
} // getExDslot ()
|
} // getExDslot ()
|
|
|
|
//! Access for the except_type value
|
|
|
|
//! @return The value of the or1200_except.except_type register
|
|
|
|
uint32_t
|
|
OrpsocAccess::getExceptType ()
|
|
{
|
|
return (or1200_except->get_except_type) ();
|
|
|
|
} // getExceptType ()
|
|
|
|
|
//! Access for the id_pc register
|
//! Access for the id_pc register
|
|
|
//! @return The value of the or1200_except.id_pc register
|
//! @return The value of the or1200_except.id_pc register
|
|
|
uint32_t
|
uint32_t
|
Line 99... |
Line 126... |
{
|
{
|
return (or1200_except->get_id_pc) ();
|
return (or1200_except->get_id_pc) ();
|
|
|
} // getIdPC ()
|
} // getIdPC ()
|
|
|
|
//! Access for the ex_pc register
|
|
|
|
//! @return The value of the or1200_except.id_ex register
|
|
|
|
uint32_t
|
|
OrpsocAccess::getExPC ()
|
|
{
|
|
return (or1200_except->get_ex_pc) ();
|
|
|
|
} // getExPC ()
|
|
|
//! Access for the wb_pc register
|
//! Access for the wb_pc register
|
|
|
//! @return The value of the or1200_except.wb_pc register
|
//! @return The value of the or1200_except.wb_pc register
|
|
|
uint32_t
|
uint32_t
|
Line 110... |
Line 148... |
{
|
{
|
return (or1200_except->get_wb_pc) ();
|
return (or1200_except->get_wb_pc) ();
|
|
|
} // getWbPC ()
|
} // getWbPC ()
|
|
|
|
//! Access for the id_insn register
|
|
|
|
//! @return The value of the or1200_ctrl.wb_insn register
|
|
|
|
uint32_t
|
|
OrpsocAccess::getIdInsn ()
|
|
{
|
|
return (or1200_ctrl->get_id_insn) ();
|
|
|
|
} // getIdInsn ()
|
|
|
|
//! Access for the ex_insn register
|
|
|
|
//! @return The value of the or1200_ctrl.ex_insn register
|
|
|
|
uint32_t
|
|
OrpsocAccess::getExInsn ()
|
|
{
|
|
return (or1200_ctrl->get_ex_insn) ();
|
|
|
|
} // getExInsn ()
|
|
|
|
|
//! Access for the wb_insn register
|
//! Access for the wb_insn register
|
|
|
//! @return The value of the or1200_ctrl.wb_insn register
|
//! @return The value of the or1200_ctrl.wb_insn register
|
|
|
uint32_t
|
uint32_t
|
Line 121... |
Line 182... |
{
|
{
|
return (or1200_ctrl->get_wb_insn) ();
|
return (or1200_ctrl->get_wb_insn) ();
|
|
|
} // getWbInsn ()
|
} // getWbInsn ()
|
|
|
//! Access for the id_insn register
|
//! Access the Wishbone SRAM memory
|
|
|
//! @return The value of the or1200_ctrl.wb_insn register
|
//! @return The value of the memory word at addr
|
|
|
uint32_t
|
uint32_t
|
OrpsocAccess::getIdInsn ()
|
OrpsocAccess::get_mem (uint32_t addr)
|
{
|
{
|
return (or1200_ctrl->get_id_insn) ();
|
return (ram_wb_sc_sw->get_mem) (addr);
|
|
|
} // getIdInsn ()
|
} // get_mem ()
|
|
|
|
//! Write value to the Wishbone SRAM memory
|
|
|
|
void
|
|
OrpsocAccess::set_mem (uint32_t addr, uint32_t data)
|
|
{
|
|
(ram_wb_sc_sw->set_mem) (addr, data);
|
|
|
|
} // set_mem ()
|
|
|
|
//! Trigger the $readmemh() system call
|
|
|
|
void
|
|
OrpsocAccess::do_ram_readmemh (void)
|
|
{
|
|
(ram_wb_sc_sw->do_readmemh) ();
|
|
|
|
} // do_ram_readmemh ()
|
|
|
//! Access for the OR1200 GPRs
|
//! Access for the OR1200 GPRs
|
|
|
//! These are extracted from memory using the Verilog function
|
//! These are extracted from memory using the Verilog function
|
|
|