Hi,
I am trying to read values from a register array on Tofino model with P4-16, but I got the following error:
I don’t know what Wide operations not supported in stateful alu, will only operate on bottom 32 bits
means.
/root/tnb/votePipe/p4src/votepipe.p4(115): [--Werror=target-error] error: Wide operations not supported in stateful alu, will only operate on bottom 32 bits
RegisterAction<flow_ID_t, register_array_size_t, flow_ID_t>(S1_flow_ID_array) read_S1_flow_ID = { void apply(inout flow_ID_t val, out flow_ID_t rv) { rv = val; } };
Here is my types and consts:
typedef bit<104> flow_ID_t;
typedef bit<32> count_value_t;
typedef bit<32> register_array_size_t;
const register_array_size_t register_array_size = 1024;
Here is my register array:
Register<flow_ID_t, register_array_size_t>(register_array_size, 0) S1_flow_ID_array;
And here I defined a READ_REGISTER
out of control block to read values from S1_flow_ID_array
:
#define READ_REGISTER(reg_name, reg_action_name, reg_data_t, reg_size_t) \
RegisterAction<reg_data_t, reg_size_t, reg_data_t>(reg_name) reg_action_name = { \
void apply(inout reg_data_t val, out reg_data_t rv) { \
rv = val; \
} \
}
Then I create this inside control block to get value from S1_flow_ID_array
:
READ_REGISTER(S1_flow_ID_array, read_S1_flow_ID, flow_ID_t, register_array_size_t);
Finally here is my apply block:
apply {
register_array_size_t arrayIndex = 100; // a value got from somewhere
flow_ID_t id = read_S1_flow_ID.execute(arrayIndex);
}
where did I go wrong?