Skip to content

Commit

Permalink
tlp/common: PTM Request generation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Aug 24, 2023
1 parent 3c59d00 commit 417357c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions litepcie/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def ptm_layout(data_width):
("request", 1), # Request.
("response", 1), # Response.
("requester_id", 16), # Requester ID.
("length", 16), # Length.
("message_code", 16), # Message Code.
("length", 10), # Length.
("message_code", 8), # Message Code.

# Data Stream.
("dat", data_width),
Expand Down
2 changes: 1 addition & 1 deletion litepcie/tlp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
)

# Length of the TLP PTM header (in bytes).
tlp_ptm_header_length = 8
tlp_ptm_header_length = 16
# Define TLP request header fields.
tlp_ptm_header_fields = {
"fmt" : HeaderField(byte=0*4, offset=29, width= 2), # Format.
Expand Down
7 changes: 4 additions & 3 deletions litepcie/tlp/packetizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def __init__(self, data_width, header_inserter_3dws_cls, header_inserter_4dws_cl
fmt_dict["mem_wr64"] : header_sel.eq(_4DWS_SEL),
fmt_dict[ "cpld"] : header_sel.eq(_3DWS_SEL),
fmt_dict[ "cpl"] : header_sel.eq(_3DWS_SEL),
fmt_dict[ "ptm_req"] : header_sel.eq(_4DWS_SEL),
fmt_dict[ "ptm_res"] : header_sel.eq(_4DWS_SEL),
})

# Header Inserters Mux.
Expand Down Expand Up @@ -944,10 +946,9 @@ def __init__(self, data_width, endianness, address_width=32, capabilities=["REQU
If(ptm_sink.response,
tlp_ptm.type.eq(type_dict["ptm_res"]),
tlp_ptm.fmt.eq( fmt_dict["ptm_res"]),
tlp_ptm.dat.eq(ptm_sink.dat),
tlp_ptm.be.eq(2**(data_width//8)-1), # CHECKME.
),

tlp_ptm.dat.eq(ptm_sink.dat),
tlp_ptm.be.eq(2**(data_width//8)-1), # CHECKME.
]

tlp_raw_ptm = stream.Endpoint(tlp_raw_layout(data_width))
Expand Down

0 comments on commit 417357c

Please sign in to comment.