frontend/axi: add resp signals

This commit is contained in:
Florent Kermarrec 2018-09-05 08:50:28 +02:00
parent 47fed1b254
commit 700f76c599
2 changed files with 14 additions and 2 deletions

View file

@ -12,6 +12,7 @@ Features:
Limitations: Limitations:
- Write response always supposed to be ready. - Write response always supposed to be ready.
- Last signals not used. - Last signals not used.
- Response always okay.
- No reordering. - No reordering.
""" """
@ -28,6 +29,13 @@ burst_types = {
"reserved": 0b11 "reserved": 0b11
} }
resp_types = {
"okay": 0b00,
"exokay": 0b01,
"slverr": 0b10,
"decerr": 0b11
}
def ax_description(address_width, id_width): def ax_description(address_width, id_width):
return [ return [
("addr", address_width), ("addr", address_width),
@ -45,11 +53,13 @@ def w_description(data_width):
def b_description(id_width): def b_description(id_width):
return [ return [
("resp", 2),
("id", id_width) ("id", id_width)
] ]
def r_description(data_width, id_width): def r_description(data_width, id_width):
return [ return [
("resp", 2),
("data", data_width), ("data", data_width),
("id", id_width) ("id", id_width)
] ]
@ -158,6 +168,7 @@ class LiteDRAMAXI2NativeW(Module):
id_buffer.sink.valid.eq(aw.valid & aw.ready), id_buffer.sink.valid.eq(aw.valid & aw.ready),
id_buffer.sink.id.eq(aw.id), id_buffer.sink.id.eq(aw.id),
axi.b.valid.eq(axi.w.valid & axi.w.ready), # Note: Write response always supposed to be ready. axi.b.valid.eq(axi.w.valid & axi.w.ready), # Note: Write response always supposed to be ready.
axi.b.resp.eq(resp_types["okay"]),
axi.b.id.eq(id_buffer.source.id), axi.b.id.eq(id_buffer.source.id),
id_buffer.source.ready.eq(axi.b.valid & axi.b.ready) id_buffer.source.ready.eq(axi.b.valid & axi.b.ready)
] ]
@ -246,7 +257,8 @@ class LiteDRAMAXI2NativeR(Module):
# Read data # Read data
self.comb += [ self.comb += [
port.rdata.connect(r_buffer.sink), port.rdata.connect(r_buffer.sink),
r_buffer.source.connect(axi.r, omit={"id"}) r_buffer.source.connect(axi.r, omit={"id"}),
axi.r.resp.eq(resp_types["okay"])
] ]

View file

@ -83,7 +83,7 @@ class LiteDRAMDMAReader(Module):
self.submodules += fifo self.submodules += fifo
self.comb += [ self.comb += [
rdata.connect(fifo.sink, omit={"bank", "id"}), rdata.connect(fifo.sink, omit={"bank", "id", "resp"}),
fifo.source.connect(source), fifo.source.connect(source),
data_dequeued.eq(source.valid & source.ready) data_dequeued.eq(source.valid & source.ready)
] ]