Emit p4info , bfrt and context for MatchValueLookupTable#16
Emit p4info , bfrt and context for MatchValueLookupTable#16kamleshbhalui wants to merge 11 commits intomainfrom
Conversation
|
correponding changes in kamleshbhalui/p4runtime#1 |
usha1830
left a comment
There was a problem hiding this comment.
I have reviewed at high level and given some comments. Please check
Also please attach a P4 program and generated p4info and bfrt json files
| BUG("Invalid oneof case for the match type of table '%1%'", pre.name()); | ||
| break; | ||
| } | ||
| addKeyField(keys_json, mf.id(), mf.name(), false /* mandatory */, |
| } | ||
| }; | ||
|
|
||
| template<> struct MatchValueLookupTableTraits<Arch::V1MODEL2020> { |
There was a problem hiding this comment.
This may be just PNA specific. Why do we add it for V1Model
There was a problem hiding this comment.
it's easiest to fix compilation rather separating again entire p4info generation mechanism for pna from rest.
anyway it will be compilation error for rest of all arches
| MatchValueLookupTable(cstring n, uint32_t kbw, std::vector<param_t> params_list, | ||
| uint32_t sz, const IR::IAnnotated* annos = nullptr) : | ||
| name(n), key_bitwidth(kbw), params(params_list), size(sz), annotations(annos) {} | ||
| static void add_mvlut_param(uint32_t ¶m_count, std::vector<param_t>* params_list, |
There was a problem hiding this comment.
I think we should add a new lines between the variable declarations, constructor call and the last static func
|
Tests are failing |
|
Test will fail here because p4info is coming from another repo called p4runtime |
psivanup
left a comment
There was a problem hiding this comment.
Looks ok to me.
Is it possible to add a testcase to emit/validate p4info, bfrt Json?
71da7a9 to
1d20474
Compare
9bb4f12 to
acede95
Compare
psivanup
left a comment
There was a problem hiding this comment.
Looks fine to me.
I'm not sure if open source repo maintainers allow adding MatchValueLookupTable to all archs or only to PNA.
| "%1%: expected size and optionally init_val as arguments", d); | ||
| } | ||
| } else if (externTypeName == "MatchValueLookupTable") { | ||
| if (d->arguments->size() != 1 && |
There was a problem hiding this comment.
Hope you check can for boundaries ( > 0 && <= 3) instead of three individual comparisons.
usha1830
left a comment
There was a problem hiding this comment.
I have few minor comments. Please check and update
| } | ||
| } | ||
| } | ||
| // for match value lookup tables decls |
There was a problem hiding this comment.
Can we not combine these two for loops?
| }; | ||
|
|
||
| struct LookupMatchAttributes { | ||
| std::vector<LookupHwBlocks*> hardware_blocks; |
There was a problem hiding this comment.
We should change this name to maybe "target_blocks" or "pipeline_blocks". DPDK is a software pipeline, so we should not use hardware. This applies to all the places where "Hardware" is used.
| (uint32_t)type->width_bits()}); | ||
| } | ||
| } | ||
| /// @return the information required to serialize an @instance of register |
There was a problem hiding this comment.
Comment says : instance of "register", should be MatchValueLookupTable instead?
8523529 to
681980d
Compare
Co-authored-by: Sivanupandi, Pitchumani <pitchumani.sivanupandi@intel.com>
* Emit context json for MatchValueLookupTable externs Co-authored-by: Subramanian, Maheswari <maheswari.subramanian@intel.com> Saroha, Yogender Singh <yogender.singh.saroha@intel.com> * Addressed comments * checks for mirror_profiles * updated field name * Remove strict condition for now about structure arg * use bits not bytes * Fix some json key names
681980d to
03c5cbe
Compare
Co-authored-by: Sivanupandi, Pitchumani pitchumani.sivanupandi@intel.com