Commit f1e82d35 authored by Maciej Lipinski's avatar Maciej Lipinski

[TOP_SIM] adding HWDU to simulation

parent de70c1ab
`define ADDR_HWDU_CR 3'h0
`define HWDU_CR_ADR_OFFSET 0
`define HWDU_CR_ADR 32'h0000ffff
`define HWDU_CR_RD_ERR_OFFSET 30
`define HWDU_CR_RD_ERR 32'h40000000
`define HWDU_CR_RD_EN_OFFSET 31
`define HWDU_CR_RD_EN 32'h80000000
`define ADDR_HWDU_REG_VAL 3'h4
`ifndef __SIMDRV_WR_HWDU
`define __SIMDRV_WR_HWDU 1
`timescale 1ns/1ps
`include "simdrv_defs.svh"
`include "regs/hwdu_regs.v"
class CSimDrv_HWDU;
protected CBusAccessor m_acc;
protected uint64_t m_base;
function new(CBusAccessor acc, uint64_t base, bit dbg=0);
m_acc = acc;
m_base = base;
endfunction // new
task set_tatsu(bit[15:0] addr);
uint64_t tmp;
m_acc.write(m_base + `ADDR_HWDU_CR,
`HWDU_CR_RD_EN | (`HWDU_CR_ADR & (addr << `HWDU_CR_ADR_OFFSET)) );
m_acc.read(m_base + `ADDR_HWDU_REG_VAL, tmp, 4);
$display("HWDU: raw_val: 0x%x, addr: 0%d",tmp, addr);
$display("HWDU: unused res: %d",'h3FF & tmp);
$display("HWDU: hp res: %d",'h3FF & (tmp >> 10));
$display("HWDU: normal res: %d",'h3FF & (tmp >> 20));
endtask;
endclass // CSimDrv_TATSU
`endif // `ifndef __SIMDRV_TATSU_SVH
This diff is collapsed.
......@@ -139,7 +139,8 @@ begin -- rtl
g_simulation => true,
g_without_network => false,
g_with_TRU => true,
g_with_TATSU => true)
g_with_TATSU => true,
g_with_HWDU => true)
port map (
sys_rst_n_i => sys_rst_n_i,
clk_startup_i => clk_startup_i,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment