Mem logger
Mem logger is wrap around DATA_LOGGER that is able to log common statistics about memory interface. Example usage can be found in MEM_TESTER component.
Key features
Measured statistics
Number of read and write requests and words (including requested read words and received read words)
Number of ticks between first and last read, write and both (SW can calculate data flow)
Read requests latencies (minimum, maximum, average and histogram)
LATENCY_METER and HISTOGRAMER components are used
You can specify if read latency should be measured to the first or last received word (default: to last word)
Component port and generics description
- ENTITY MEM_LOGGER IS
- Generics
Generic
Type
Default
Description
MEM_DATA_WIDTH
integer
512
MEM_ADDR_WIDTH
integer
26
MEM_BURST_COUNT_WIDTH
integer
7
MEM_FREQ_KHZ
integer
300000
MI_DATA_WIDTH
integer
32
MI_ADDR_WIDTH
integer
32
HISTOGRAM_BOXES
integer
255
Specify read latency histogram precision
MAX_PARALEL_READS
integer
128
Specify maximum paraller read requests
LATENCY_TICKS_WIDTH
integer
12
Specify read latency ticks count width
MEM_ASYNC
boolean
true
DEVICE
string
“AGILEX”
Port
Type
Mode
Description
CLK
std_logic
in
RST
std_logic
in
Synchronous to CLK
RST_DONE
std_logic
out
Synchronous to CLK
=====
Memory interface
=====
=====
MEM_CLK
std_logic
in
MEM_RST
std_logic
in
MEM_READY
std_logic
in
MEM_READ
std_logic
in
MEM_WRITE
std_logic
in
MEM_ADDRESS
std_logic_vector(MEM_ADDR_WIDTH - 1 downto 0)
in
MEM_READ_DATA
std_logic_vector(MEM_DATA_WIDTH - 1 downto 0)
in
MEM_WRITE_DATA
std_logic_vector(MEM_DATA_WIDTH - 1 downto 0)
in
MEM_BURST_COUNT
std_logic_vector(MEM_BURST_COUNT_WIDTH - 1 downto 0)
in
MEM_READ_DATA_VALID
std_logic
in
=====
MI bus interface
=====
=====
MI_DWR
std_logic_vector(MI_DATA_WIDTH - 1 downto 0)
in
MI_ADDR
std_logic_vector(MI_ADDR_WIDTH - 1 downto 0)
in
MI_BE
std_logic_vector(MI_DATA_WIDTH / 8 - 1 downto 0)
in
MI_RD
std_logic
in
MI_WR
std_logic
in
MI_ARDY
std_logic
out
MI_DRD
std_logic_vector(MI_DATA_WIDTH - 1 downto 0)
out
MI_DRDY
std_logic
out
Instance template (simple usage)
mem_logger_i : entity work.MEM_LOGGER
generic map (
MEM_DATA_WIDTH => MEM_DATA_WIDTH ,
MEM_ADDR_WIDTH => MEM_ADDR_WIDTH ,
MEM_BURST_COUNT_WIDTH => MEM_BURST_WIDTH ,
MEM_FREQ_KHZ => AMM_FREQ_KHZ ,
MI_DATA_WIDTH => MI_DATA_WIDTH ,
MI_ADDR_WIDTH => MI_ADDR_WIDTH
)
port map (
CLK => MEM_CLK (i),
RST => MEM_RST (i),
MEM_READY => MEM_AVMM_READY (i),
MEM_READ => MEM_AVMM_READ (i),
MEM_WRITE => MEM_AVMM_WRITE (i),
MEM_ADDRESS => MEM_AVMM_ADDRESS (i),
MEM_READ_DATA => MEM_AVMM_READDATA (i),
MEM_WRITE_DATA => MEM_AVMM_WRITEDATA (i),
MEM_BURST_COUNT => MEM_AVMM_BURSTCOUNT (i),
MEM_READ_DATA_VALID => MEM_AVMM_READDATAVALID (i),
MI_DWR => mem_mi_dwr (i),
MI_ADDR => mem_mi_addr (i),
MI_BE => mem_mi_be (i),
MI_RD => mem_mi_rd (i),
MI_WR => mem_mi_wr (i),
MI_ARDY => mem_mi_ardy (i),
MI_DRD => mem_mi_drd (i),
MI_DRDY => mem_mi_drdy (i)
);
Control SW
First install DATA_LOGGER
package
You also need to install
python nfb
package
cd data_logger/sw
python3 setup.py install --user
Then you can call MEM_LOGGER
module from your script or call MEM_LOGGER
directly:
python3 mem_logger.py