Skip to content

byte enable checked but not used in memory component #116

@JoGei

Description

@JoGei

template <unsigned long long SIZE, unsigned BUSWIDTH, unsigned PAGE_ADDR_BITS, bool USE_CYCLES>
int memory<SIZE, BUSWIDTH, PAGE_ADDR_BITS, USE_CYCLES>::handle_operation(tlm::tlm_generic_payload& trans, sc_core::sc_time& delay) {
uint64_t adr = trans.get_address();
uint8_t* ptr = trans.get_data_ptr();
unsigned len = trans.get_data_length();
uint8_t* byt = trans.get_byte_enable_ptr();
unsigned wid = trans.get_streaming_width();

In the memory peripheral, the handle_operation performs a sanity check on the byte enable transaction parameter:

if(byt) {
auto res = std::accumulate(byt, byt + trans.get_byte_enable_length(), 0xff, [](uint8_t a, uint8_t b) { return a | b; });
if(trans.get_byte_enable_length() != len || res != 0xff) {
SC_REPORT_ERROR("TLM-2", "generic payload transaction with scattered byte enable not supported");
trans.set_response_status(tlm::TLM_GENERIC_ERROR_RESPONSE);
return 0;
}
}

In its actual transmission logic, no byte enable is consumed from the data stream. Is this is intentional?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions