/******************************************************************************* * Module: status_read * Date:2015-01-14 * Author: andrey * Description: Receives status read data (low bandwidth) from multiple * subsystems byte-serial, stores in axi-addressable memory * 8-bita ddress is received from the source module, * as well as another (optional) byte of sequence number (set in write command) * Sequence number (received first afther the address) is stored as a high byte, * lower bytes are the actual payload, starting from lower byte (not all 3 are * required. Single-bit responsen can be combined in the same byte with the * sequence number to use just 2-byte packets? * TODO: add interrupt capabilities * * Copyright (c) 2015 . * status_read.v is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * status_read.v is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . *******************************************************************************/ `timescale 1ns/1ps module status_read#( parameter STATUS_ADDR = 'h1400, // AXI write address of status read registers parameter STATUS_ADDR_MASK = 'h1400, // AXI write address of status registers parameter AXI_RD_ADDR_BITS = 13, parameter integer STATUS_DEPTH= 8 // 256 cells, maybe just 16..64 are enough? )( input rst, input clk, input [AXI_RD_ADDR_BITS-1:0] axi_pre_addr, // status read address, 1 cycle ahead of read data input pre_stb, // read data request, with axi_pre_addr output reg [31:0] axi_status_rdata, // read data, 1 cycle latency from the address/stb output reg data_valid, // read data valid, 1 cycle latency from pre_stb, decoded address input [7:0] ad, // byte-serial status data from the sources input rq, // request from sources to transfer status data output start // acknowledge receiving of first byte (address), currently always ready ); localparam integer DATA_2DEPTH=(1<