Skip to content

Commit

Permalink
Support SCR address generation with __OFFSET at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-dabbelt committed Feb 26, 2016
1 parent 640204b commit 8c73d10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions csrc/htif_emulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ class htif_emulator_t : public htif_pthread_t

void set_clock_divisor(int divisor, int hold_cycles)
{
#ifdef UNCORE_SCR__HTIF_IO_CLOCK_DIVISOR
#ifdef UNCORE_SCR__HTIF_IO_CLOCK_DIVISOR__OFFSET
/* We only want to write the HTIF clock divisor SCR on targets where it
* actually exists (there isn't one on the FPGA, for example). */
write_cr(-1, UNCORE_SCR__HTIF_IO_CLOCK_DIVISOR, divisor | hold_cycles << 16);
write_cr(-1, UNCORE_SCR__HTIF_IO_CLOCK_DIVISOR__OFFSET, divisor | hold_cycles << 16);
#endif
}

void start()
{
set_clock_divisor(5, 2);
write_cr(-1, UNCORE_SCR__MEMORY_CHANNEL_MUX_SELECT, memory_channel_mux_select);
write_cr(-1, UNCORE_SCR__MEMORY_CHANNEL_MUX_SELECT__OFFSET, memory_channel_mux_select);
htif_pthread_t::start();
}

Expand Down
2 changes: 1 addition & 1 deletion uncore

0 comments on commit 8c73d10

Please sign in to comment.