17 #ifndef __LITESUBORDINATETOMEM_H__
18 #define __LITESUBORDINATETOMEM_H__
21 #include <ac_reset_signal_is.h>
23 #include <hls_globals.h>
25 #include <mem_array.h>
53 template <
int capacity>
58 static const int capacity_in_bytes = capacity;
59 static const int banks = 1;
61 typedef typename axi_::Data Data;
67 axi_::read::template subordinate<> if_rd;
68 axi_::write::template subordinate<> if_wr;
70 sc_in<bool> reset_bar;
74 : if_rd(
"if_rd"), if_wr(
"if_wr"), reset_bar(
"reset_bar"), clk(
"clk") {
76 sensitive << clk.pos();
77 async_reset_signal_is(reset_bar,
false);
96 #pragma hls_pipeline_init_interval 4
97 #pragma pipeline_stall_mode flush
101 bool rd_resp_pend_local = rd_resp_pend;
102 bool wr_resp_pend_local = wr_resp_pend;
106 if (!rd_resp_pend_local) {
107 rd_mem = (if_rd.nb_aread(rd_addr_pld));
109 data_pld.resp = axi_::Enc::XRESP::OKAY;
110 rd_resp_pend_local =
true;
114 if (!wr_resp_pend_local) {
115 wr_mem = if_wr.nb_wread(wr_addr_pld, write_pld);
118 resp_pld.resp = axi_::Enc::XRESP::OKAY;
119 wr_resp_pend_local =
true;
124 data_pld.data = memarray.read(rd_addr_pld.addr);
126 memarray.write(wr_addr_pld.addr,0,write_pld.data);
127 if (rd_resp_pend_local) {
128 rd_resp_pend_local = !(if_rd.nb_rwrite(data_pld));
131 if (wr_resp_pend_local) {
132 wr_resp_pend_local = !(if_wr.nb_bwrite(resp_pld));
134 rd_resp_pend = rd_resp_pend_local;
135 wr_resp_pend = wr_resp_pend_local;
An AXI subordinate SRAM for the AXI-Lite protocol.
The base axi4 class parameterized according a valid config.
A struct composed of the signals associated with AXI read and write requests.
A struct composed of the signals associated with an AXI read response.
A struct composed of the signals associated with an AXI write response.
A struct composed of the signals associated with AXI write data.