I need help . I have assignment !!
Write vhdl code for 4 bit bidirectional universal shift register using behavioral style of modeling.
![]()
Write vhdl code for 4 bit bidirectional universal shift register using behavioral style of modeling.
down votefavorite |
I am trying to access data from HPS via Avalon memory mapping interface. I have put together system in Qsys and assigned base address. In below code the I got the count value in 1st 32 bit std_logic_vector data to the HPS. But I didn't get the data in second 32 bit std_logic_vector |
0down votefavorite |
I am trying to access data from HPS via Avalon memory mapping interface. I have put together system in Qsys and assigned base address. In below code the I got the count value in 1st 32 bit std_logic_vector (count) data to the HPS. But I didn't get the data in second 32 bit std_logic_vector (count_n) |
for (int i = 0; i < 10; i++)
{}
int i;
for (i = 0; i < 10; i++)
{}
ALT_PRINTF("RSTMGR %08x\n", alt_read_word(SOCFPGA_RSTMGR_ADDRESS));
board_init()
{
...
...
sysmgr_pinmux_init();
releasing_all_peripherals_from_reset(); <--- added by me
warm_reset_handshake_support(); <--- added by me
alt_bridge_init(ALT_BRIDGE_LWH2F, NULL, NULL); <--- added by me
alt_write_word(ALT_L3_REMAP_ADDR, 0x18 | 0x1); // remap 0x0 to OCRAM, Maintain FPGA connection <--- moved from the end of the board_init()
// thaw (un-freeze) all IO banks
sys_mgr_frzctrl_thaw_req(FREEZE_CHANNEL_0, FREEZE_CONTROLLER_FSM_SW);
sys_mgr_frzctrl_thaw_req(FREEZE_CHANNEL_1, FREEZE_CONTROLLER_FSM_SW);
sys_mgr_frzctrl_thaw_req(FREEZE_CHANNEL_2, FREEZE_CONTROLLER_FSM_SW);
sys_mgr_frzctrl_thaw_req(FREEZE_CHANNEL_3, FREEZE_CONTROLLER_FSM_SW);
void sw_get_command(cmd_type *cmd) {
alt_u8 btn;
btn = (alt_u8) btn_read(BTN_BASE) & 0xf; // read 4 pushbuttons
if (btn != 0) { // a button pressed
if (btn & 0x01) // button 0 pressed
cmd->pause = cmd->pause ^ 1; // toggle pause bit
if (btn & 0x02) // button 1 pressed
cmd->prd = pio_read(SWITCH_BASE) & 0x03ff; // load new interval
if (btn & 0x04)
{
alt_u8 rvalid = 0;
alt_u32 data_reg = 0;
do{
data_reg = IORD(JTAG_UART_BASE, JUART_DATA_REG_OFT);
rvalid = data_reg >> 15 & 0x01;
} while (rvalid == 0);
printf("data = %c\n", (char)data_reg & 0xff);
printf("ravail = %d\n", (data_reg >> 16) & 0xffff);
}
btn_clear(BTN_BASE);
}
}