[Register] error while reading value from a register array

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?

Well, I found that register only support " bit<8>, int<8>, bit<16>, int<16>, bit<32>, or int<32> values".

However, I want to store a 5-tuple(104b) in data plane.

are there any other components can store that in data plane? I need to read or write with a specific 5-tuple.

Thanks!

@AcmeT ,

First of all, I would recommend you direct all your Tofino-specific questions to the appropriate support communities at Intel.

However, with regards to your specific one, there is a simple answer: you can use multiple registers working in parallel: one register to store the first 32-bits of your 104-bit string, another one to store the next 32-bits of that 104-bit string, etc. Ultimately, this is no different compared to how we store data in computer memory by dividing it into 8-bit chunks, called “bytes”.

1 Like