📄 host_icomp.vhd
字号:
-------------------------------------------------------------------- -- -- Read the status of the memory write -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- Status register for Left Mem dwordCount := 1; Done := FALSE; while ( not Done ) loop WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); if ( regData(0) mod 2 = 1 ) then assert FALSE report "PE1 Data write to 0x3000 has completed" severity NOTE; Done := TRUE; end if; wait for 1 us; end loop; --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- -- Step 6 : Reset each of the PEs by writing to their reset -- registers that are mapped to LAD bus register space -- DWORD address 0x01000 in their respective PEs. -- --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- -- Reset the PE1 device -- peNum := WS_PE1; dwordOffset := 16#00000800#; -- Reset register dwordCount := 1; regData(0) := 1; WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); assert FALSE report "============ All PEs are now reset ============" severity NOTE; --Wait for the ARM program to run for a while wait for 1000 us; -------------------------------------------------------------------- -- -- Select the host to be connected to the memories -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000900#; -- Control register for PE1 dwordCount := 1; regData(0) := 16#00000001#; -- Bit 0 Host/App WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Write the block RAM buffer offset and memory address -- to the first control register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- First control register for Left Mem dwordCount := 1; regData(0) := 16#00002000#; -- Offset : bits 31 downto 23 = 0x000 -- Address : bits 22 downto 0 = 0x000 WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Write the memory access type and DWORD count -- to the second control register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000001#; -- Second control register for Left Mem dwordCount := 1; regData(0) := 16#00100008#; -- Write_Sel_n : bit 20 = 1 -- DWORD count : bits 7 downto 0 = 256 WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Trigger the memory read by writing to the third register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000003#; -- Third control register for Left Mem dwordCount := 1; regData(0) := 16#00000000#; -- Don't care WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Read the status of the memory read -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- Status register for Left Mem dwordCount := 1; Done := FALSE; while ( not Done ) loop WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); if ( regData(0) mod 2 = 1 ) then assert FALSE report "PE1 Read from 0x2000 has completed" severity NOTE; Done := TRUE; end if; wait for 1 us; end loop; -------------------------------------------------------------------- -- -- Read the memory data from the block RAM -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000100#; -- Block RAM for Mem dwordCount := 8; WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, memData ); for i in 0 to 7 loop assert FALSE report "PE mem(200" & integer'image(i) & ") = " & integer'image(memData(i)) severity NOTE; end loop; -------------------------------------------------------------------- -- -- Write the block RAM buffer offset and memory address -- to the first control register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- First control register for Left Mem dwordCount := 1; regData(0) := 16#00001000#; -- Offset : bits 31 downto 23 = 0x000 -- Address : bits 22 downto 0 = 0x000 WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Write the memory access type and DWORD count -- to the second control register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000001#; -- Second control register for Left Mem dwordCount := 1; regData(0) := 16#00100008#; -- Write_Sel_n : bit 20 = 1 -- DWORD count : bits 7 downto 0 = 256 WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Trigger the memory read by writing to the third register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000003#; -- Third control register for Left Mem dwordCount := 1; regData(0) := 16#00000000#; -- Don't care WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Read the status of the memory read -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- Status register for Left Mem dwordCount := 1; Done := FALSE; while ( not Done ) loop WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); if ( regData(0) mod 2 = 1 ) then assert FALSE report "PE1 Read from 0x2000 has completed" severity NOTE; Done := TRUE; end if; wait for 1 us; end loop; -------------------------------------------------------------------- -- -- Read the memory data from the block RAM -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000100#; -- Block RAM for Mem dwordCount := 8; WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, memData ); for i in 0 to 7 loop assert FALSE report "PE mem(100" & integer'image(i) & ") = " &integer'image(memData(i)) severity NOTE; end loop; -------------------------------------------------------------------- -- -- Write the block RAM buffer offset and memory address -- to the first control register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- First control register for Left Mem dwordCount := 1; regData(0) := 16#00001000#; -- Offset : bits 31 downto 23 = 0x000 -- Address : bits 22 downto 0 = 0x000 WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Write the memory access type and DWORD count -- to the second control register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000001#; -- Second control register for Left Mem dwordCount := 1; regData(0) := 16#00100008#; -- Write_Sel_n : bit 20 = 1 -- DWORD count : bits 7 downto 0 = 256 WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Trigger the memory read by writing to the third register -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000003#; -- Third control register for Left Mem dwordCount := 1; regData(0) := 16#00000000#; -- Don't care WS_WritePeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); -------------------------------------------------------------------- -- -- Read the status of the memory read -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000000#; -- Status register for Left Mem dwordCount := 1; Done := FALSE; while ( not Done ) loop WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, regData ); if ( regData(0) mod 2 = 1 ) then assert FALSE report "PE1 Read from 0x2000 has completed" severity NOTE; Done := TRUE; end if; wait for 1 us; end loop; -------------------------------------------------------------------- -- -- Read the memory data from the block RAM -- -------------------------------------------------------------------- peNum := WS_PE1; dwordOffset := 16#00000100#; -- Block RAM for Mem dwordCount := 8; WS_ReadPeReg ( Cmd_Req, Cmd_Ack, board, peNum, dwordOffset, dwordCount, memData ); for i in 0 to 7 loop assert FALSE report "PE mem(000" & integer'image(i) & ") = " &integer'image(memData(i)) severity NOTE; end loop; wait; -- end of simulated host program end process; end Mem_Copy;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -