import "primitives/core.futil"; import "primitives/tcam.futil"; component main() -> () { cells { tcam = TCAM_IPv4(); @external(1) index = std_mem_d1(5, 1, 1); } wires { group save_index<"static"=1> { index.write_en = 1'd1; index.addr0 = 1'd0; index.write_data = tcam.index; save_index[done] = index.done; } } control { seq { // 1100xxxxxxxxxxxxxxxxxxxxxxxxxxxx invoke tcam(write_en=1'd1, write_index=5'd0, in=32'b11000000000000000000000000000000, prefix_len=6'd4)(); // 110001xxxxxxxxxxxxxxxxxxxxxxxxxx invoke tcam(write_en=1'd1, write_index=5'd1, in=32'b11000100000000000000000000000000, prefix_len=6'd6)(); // 11000xxxxxxxxxxxxxxxxxxxxxxxxxxx invoke tcam(write_en=1'd1, write_index=5'd2, in=32'b11000000000000000000000000000000, prefix_len=6'd5)(); // Search. invoke tcam(search_en=1'd1, in=32'b11000000000000000000000000000000)(); save_index; } } }