Line 37... |
Line 37... |
#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"
|
// Need RAM instantiation has parameters after module name
|
// Need RAM instantiation has parameters after module name
|
// Includes for wb_ram
|
// Include for ram_wb
|
//#include "Vorpsoc_top_ram_wb__D20_A19_M800000.h"
|
#include "Vorpsoc_top_ram_wb__A20_D20_M800000_MB17.h"
|
//#include "Vorpsoc_top_ram_wb_sc_sw__D20_A19_M800000.h"
|
// Include for ram_wb_b3
|
// Include for wb_ram_b3
|
#include "Vorpsoc_top_ram_wb_b3__pi3.h"
|
#include "Vorpsoc_top_wb_ram_b3__D20_A17_M800000.h"
|
|
// Bus arbiter include - but is for old arbiter, no longer used
|
|
//#include "Vorpsoc_top_wb_conbus_top__pi1.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 61... |
Line 58... |
or1200_except = orpsoc_top->v->or1200_top0->or1200_cpu->or1200_except;
|
or1200_except = orpsoc_top->v->or1200_top0->or1200_cpu->or1200_except;
|
or1200_sprs = orpsoc_top->v->or1200_top0->or1200_cpu->or1200_sprs;
|
or1200_sprs = orpsoc_top->v->or1200_top0->or1200_cpu->or1200_sprs;
|
rf_a = orpsoc_top->v->or1200_top0->or1200_cpu->or1200_rf->rf_a;
|
rf_a = orpsoc_top->v->or1200_top0->or1200_cpu->or1200_rf->rf_a;
|
// Assign main memory accessor objects
|
// Assign main memory accessor objects
|
// For old ram_wb: ram_wb_sc_sw = orpsoc_top->v->ram_wb0->ram0;
|
// For old ram_wb: ram_wb_sc_sw = orpsoc_top->v->ram_wb0->ram0;
|
ram_wb_sc_sw = orpsoc_top->v->wb_ram_b3_0;
|
//ram_wb_sc_sw = orpsoc_top->v->wb_ram_b3_0;
|
|
wishbone_ram = orpsoc_top->v->ram_wb0->ram_wb_b3_0;
|
|
|
// Assign arbiter accessor object
|
// Assign arbiter accessor object
|
//wb_arbiter = orpsoc_top->v->wb_conbus;
|
//wb_arbiter = orpsoc_top->v->wb_conbus;
|
|
|
} // OrpsocAccess ()
|
} // OrpsocAccess ()
|
Line 198... |
Line 196... |
//! @return The value of the 32-bit memory word at addr
|
//! @return The value of the 32-bit memory word at addr
|
|
|
uint32_t
|
uint32_t
|
OrpsocAccess::get_mem32 (uint32_t addr)
|
OrpsocAccess::get_mem32 (uint32_t addr)
|
{
|
{
|
return (ram_wb_sc_sw->get_mem) (addr/4);
|
return (wishbone_ram->get_mem) (addr/4);
|
|
|
} // get_mem32 ()
|
} // get_mem32 ()
|
|
|
|
|
//! Access a byte from the Wishbone SRAM memory
|
//! Access a byte from the Wishbone SRAM memory
|
Line 220... |
Line 218... |
addr = addr / 4;
|
addr = addr / 4;
|
if (addr != cached_word_addr)
|
if (addr != cached_word_addr)
|
{
|
{
|
cached_word_addr = addr;
|
cached_word_addr = addr;
|
// Convert address to word number here
|
// Convert address to word number here
|
word = (ram_wb_sc_sw->get_mem) (addr);
|
word = (wishbone_ram->get_mem) (addr);
|
cached_word = word;
|
cached_word = word;
|
}
|
}
|
else
|
else
|
word = cached_word;
|
word = cached_word;
|
|
|
Line 253... |
Line 251... |
//! Write value to the Wishbone SRAM memory
|
//! Write value to the Wishbone SRAM memory
|
|
|
void
|
void
|
OrpsocAccess::set_mem32 (uint32_t addr, uint32_t data)
|
OrpsocAccess::set_mem32 (uint32_t addr, uint32_t data)
|
{
|
{
|
(ram_wb_sc_sw->set_mem) (addr/4, data);
|
(wishbone_ram->set_mem) (addr/4, data);
|
|
|
} // set_mem32 ()
|
} // set_mem32 ()
|
|
|
//! Trigger the $readmemh() system call
|
//! Trigger the $readmemh() system call
|
|
|
void
|
void
|
OrpsocAccess::do_ram_readmemh (void)
|
OrpsocAccess::do_ram_readmemh (void)
|
{
|
{
|
(ram_wb_sc_sw->do_readmemh) ();
|
(wishbone_ram->do_readmemh) ();
|
|
|
} // do_ram_readmemh ()
|
} // do_ram_readmemh ()
|
|
|
//! Access for the OR1200 GPRs
|
//! Access for the OR1200 GPRs
|
|
|