data/full_repos/permissive/129989088/lookup_flowKTb.v
 line:135: before: "."
1: b'%Error: data/full_repos/permissive/129989088/lookup_flowKTb.v:123: Cannot find file containing module: \'fifo\'\nfifo meta_buffer(\n^~~~\n        ... Looked in:\n             data/full_repos/permissive/129989088,data/full_repos/permissive/129989088/fifo\n             data/full_repos/permissive/129989088,data/full_repos/permissive/129989088/fifo.v\n             data/full_repos/permissive/129989088,data/full_repos/permissive/129989088/fifo.sv\n             fifo\n             fifo.v\n             fifo.sv\n             obj_dir/fifo\n             obj_dir/fifo.v\n             obj_dir/fifo.sv\n%Error: data/full_repos/permissive/129989088/lookup_flowKTb.v:141: Cannot find file containing module: \'fifo\'\nfifo flowKIdx_info_buffer(\n^~~~\n%Warning-WIDTH: data/full_repos/permissive/129989088/lookup_flowKTb.v:219: Operator EQ expects 8 bits on the RHS, but RHS\'s VARREF \'ONLY_SYN\' generates 6 bits.\n                                                                         : ... In instance lookup_flowKTb\n     if((tcpFlag_temp == ONLY_SYN) && (hit_temp == 1\'b1)) begin\n                      ^~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/129989088/lookup_flowKTb.v:254: Operator EQ expects 8 bits on the RHS, but RHS\'s VARREF \'ONLY_SYN\' generates 6 bits.\n                                                                         : ... In instance lookup_flowKTb\n       if((tcpFlag_temp == ONLY_SYN) && (hit_temp == 1\'b1))begin\n                        ^~\n%Warning-WIDTH: data/full_repos/permissive/129989088/lookup_flowKTb.v:245: Operator NEQ expects 16 bits on the LHS, but LHS\'s SEL generates 3 bits.\n                                                                         : ... In instance lookup_flowKTb\n      if(ctx_flowKTb[b_nextIdx_flowKTb+d_flowKTb-1:b_nextIdx_flowKTb] != {w_idx{1\'b0}}) \n                                                                      ^~\n%Error: Exiting due to 2 error(s), 3 warning(s)\n'
module lookup_flowKTb(
reset,
clk,
metadata_in_valid,
metadata_in,
flowK_idx_valid,
flowK_idx_info,
idx_flowKTb,
rdValid_flowKTb,
ctx_flowKTb,
conn_idx_valid,
conn_idx_info,
conn_add_valid,
conn_add_info,
pull_freeFlowID_enable,
free_flowID
);


parameter 	w_meta = 113,
			w_key = 104,
			w_tcpFlag = 8,
			d_connTb = 3,
			w_flowKTb = 120,
			d_flowKTb = 3,
			d_idxBuffer = 5,
			words_idxBuffer = 32,
			w_idx = 16,
			w_flowID = 16,
			w_flowKIdx_info = 16,
			w_connIdx_info = 19,


			w_connAdd_info = 120,


			b_protocol_key = 96,
			b_dstPort_key = 80,
			b_srcPort_key = 64,
			b_dstIP_key = 32,
			b_srcIP_key = 0,
			w_proto = 8,
			w_ip = 32,
			w_port = 16,

			b_flowK_flowKTb = 16,
			b_nextIdx_flowKTb = 0,

			ONLY_SYN = 6'h02;

input								clk;
input								reset;
input								metadata_in_valid;
input		[w_meta-1:0]			metadata_in;
input								flowK_idx_valid;
input		[w_flowKIdx_info-1:0]	flowK_idx_info;
output	reg	[d_flowKTb-1:0]		idx_flowKTb;
output	reg							rdValid_flowKTb;
input		[w_flowKTb-1:0]		ctx_flowKTb;
output	reg							conn_idx_valid;
output	reg	[w_connIdx_info-1:0]	conn_idx_info;
output	reg							conn_add_valid;
output	reg	[w_connAdd_info-1:0]	conn_add_info;
output	reg							pull_freeFlowID_enable;
input		[w_flowID-1:0]			free_flowID;




reg									rdreq_meta;
wire								empty_meta;
wire		[w_meta-1:0]			ctx_meta;


reg									rdreq_flowKIdx_info;
wire								empty_flowKIdx_info;
wire		[w_flowKIdx_info-1:0]	ctx_flowKIdx_info;


reg			[w_key-1:0]				flowKey_temp[1:0];
reg			[w_tcpFlag-1:0]			tcpFlag_temp;
reg									hit_temp;


reg 			[12:0]					pad13;



reg	[3:0]	state_searchFlowKTb;
parameter	IDLE_S				= 4'd0,
			READ_BUFFER_S	= 4'd1,
			WAIT_RAM_1_S		= 4'd2,
			WAIT_RAM_2_S		= 4'd3,
			READ_FLOWKTB_S	= 4'd4,
			ADD_A_FLOW_S	= 4'd5;




fifo meta_buffer(
.aclr(!reset),
.clock(clk),
.data(metadata_in),
.rdreq(rdreq_meta),
.wrreq(metadata_in_valid),
.empty(empty_meta),
.full(),
.q(ctx_meta),
.usedw()
);
defparam
	meta_buffer.width = w_meta,
	meta_buffer.depth = d_idxBuffer,
	meta_buffer.words = words_idxBuffer;


fifo flowKIdx_info_buffer(
.aclr(!reset),
.clock(clk),
.data(flowK_idx_info),
.rdreq(rdreq_flowKIdx_info),
.wrreq(flowK_idx_valid),
.empty(empty_flowKIdx_info),
.full(),
.q(ctx_flowKIdx_info),
.usedw()
);
defparam
	flowKIdx_info_buffer.width = w_flowKIdx_info,
	flowKIdx_info_buffer.depth = d_idxBuffer,
	flowKIdx_info_buffer.words = words_idxBuffer;

		


always @(posedge clk or negedge reset) begin
	if (!reset) begin
		rdreq_flowKIdx_info <= 1'b0;
		rdreq_meta <= 1'b0;
		conn_add_valid <= 1'b0;
		conn_add_info <= {w_connAdd_info{1'b0}};
		conn_idx_valid <= 1'b0;
		conn_idx_info <= {w_connIdx_info{1'b0}};
		rdValid_flowKTb <= 1'b0;
		idx_flowKTb <= {d_flowKTb{1'b0}};
		pull_freeFlowID_enable <= 1'b0;
		
		state_searchFlowKTb <= IDLE_S;
	end
	else begin
		case(state_searchFlowKTb)
			IDLE_S: begin
				conn_add_valid <=  1'b0;
				conn_idx_valid <= 1'b0;
				if(empty_flowKIdx_info == 1'b0) begin
					rdreq_flowKIdx_info <= 1'b1;
					rdreq_meta <= 1'b1;
					state_searchFlowKTb <= READ_BUFFER_S;
				end
				else begin
					state_searchFlowKTb <= IDLE_S;
				end
			end
			READ_BUFFER_S: begin
				rdreq_flowKIdx_info <= 1'b0;
				rdreq_meta <= 1'b0;
				{hit_temp, flowKey_temp[0], tcpFlag_temp} <= ctx_meta;
				{pad13, idx_flowKTb} <= ctx_flowKIdx_info;
				rdValid_flowKTb <= 1'b1;
				state_searchFlowKTb <= WAIT_RAM_1_S;
			end
			WAIT_RAM_1_S: begin
				rdValid_flowKTb <= 1'b0;
				state_searchFlowKTb <= WAIT_RAM_2_S;
				flowKey_temp[1] <= {
					flowKey_temp[0][b_protocol_key+w_proto-1:b_protocol_key], 
					flowKey_temp[0][b_srcPort_key+w_port-1:b_srcPort_key],
					flowKey_temp[0][b_dstPort_key+w_port-1:b_dstPort_key], 
					flowKey_temp[0][b_srcIP_key+w_ip-1:b_srcIP_key], 
					flowKey_temp[0][b_dstIP_key+w_ip-1:b_dstIP_key]};
			end
			WAIT_RAM_2_S: begin
				state_searchFlowKTb <= READ_FLOWKTB_S;
			end
			READ_FLOWKTB_S: begin
				if(idx_flowKTb == {d_flowKTb{1'b0}}) begin

					if((tcpFlag_temp == ONLY_SYN) && (hit_temp == 1'b1)) begin
						pull_freeFlowID_enable <= 1'b1;
						state_searchFlowKTb <= ADD_A_FLOW_S;
					end
					else begin
						state_searchFlowKTb <= IDLE_S;
						conn_idx_valid <= 1'b1;
						conn_idx_info <= {w_connIdx_info{1'b0}};
					end
				end
				else begin
					if(flowKey_temp[0] == ctx_flowKTb[b_flowK_flowKTb+w_key-1:
						b_flowK_flowKTb]) 
					begin
						conn_idx_valid <= 1'b1;
						conn_idx_info <= {1'b1,1'b0,1'b0,pad13,idx_flowKTb};
						state_searchFlowKTb <= IDLE_S;
					end
					else if(flowKey_temp[1] == ctx_flowKTb[b_flowK_flowKTb+w_key-1:
						b_flowK_flowKTb]) 
					begin
						conn_idx_valid <= 1'b1;
						conn_idx_info <= {1'b1,1'b0,1'b1,pad13,idx_flowKTb};
						state_searchFlowKTb <= IDLE_S;
					end
					else begin
						if(ctx_flowKTb[b_nextIdx_flowKTb+d_flowKTb-1:b_nextIdx_flowKTb] != {w_idx{1'b0}}) 
						begin

							idx_flowKTb <= ctx_flowKTb[b_nextIdx_flowKTb+d_flowKTb-1:
								b_nextIdx_flowKTb];
							rdValid_flowKTb <= 1'b1;
							state_searchFlowKTb <= WAIT_RAM_1_S;
						end
						else begin
							if((tcpFlag_temp == ONLY_SYN) && (hit_temp == 1'b1))begin
								pull_freeFlowID_enable <= 1'b1;
								state_searchFlowKTb <= ADD_A_FLOW_S;
							end
							else begin
								state_searchFlowKTb <= IDLE_S;
								conn_idx_valid <= 1'b1;
								conn_idx_info <= {w_connIdx_info{1'b0}};
							end
						end
					end
				end
			end
			ADD_A_FLOW_S: begin 

				pull_freeFlowID_enable <= 1'b0;
				conn_add_valid <= 1'b1;
				conn_add_info <= {flowKey_temp[0],free_flowID};
				conn_idx_valid <= 1'b1;
				conn_idx_info <=  {1'b0,1'b1,1'b0, free_flowID};
				state_searchFlowKTb <= IDLE_S;
			end
			default: begin
				state_searchFlowKTb <= IDLE_S;
			end
		endcase
	end
end

endmodule
module lookup_flowKTb(
reset,
clk,
metadata_in_valid,
metadata_in,
flowK_idx_valid,
flowK_idx_info,
idx_flowKTb,
rdValid_flowKTb,
ctx_flowKTb,
conn_idx_valid,
conn_idx_info,
conn_add_valid,
conn_add_info,
pull_freeFlowID_enable,
free_flowID
);



parameter 	w_meta = 113,
			w_key = 104,
			w_tcpFlag = 8,
			d_connTb = 3,
			w_flowKTb = 120,
			d_flowKTb = 3,
			d_idxBuffer = 5,
			words_idxBuffer = 32,
			w_idx = 16,
			w_flowID = 16,
			w_flowKIdx_info = 16,
			w_connIdx_info = 19,


			w_connAdd_info = 120,


			b_protocol_key = 96,
			b_dstPort_key = 80,
			b_srcPort_key = 64,
			b_dstIP_key = 32,
			b_srcIP_key = 0,
			w_proto = 8,
			w_ip = 32,
			w_port = 16,

			b_flowK_flowKTb = 16,
			b_nextIdx_flowKTb = 0,

			ONLY_SYN = 6'h02;

input								clk;
input								reset;
input								metadata_in_valid;
input		[w_meta-1:0]			metadata_in;
input								flowK_idx_valid;
input		[w_flowKIdx_info-1:0]	flowK_idx_info;
output	reg	[d_flowKTb-1:0]		idx_flowKTb;
output	reg							rdValid_flowKTb;
input		[w_flowKTb-1:0]		ctx_flowKTb;
output	reg							conn_idx_valid;
output	reg	[w_connIdx_info-1:0]	conn_idx_info;
output	reg							conn_add_valid;
output	reg	[w_connAdd_info-1:0]	conn_add_info;
output	reg							pull_freeFlowID_enable;
input		[w_flowID-1:0]			free_flowID;




reg									rdreq_meta;
wire								empty_meta;
wire		[w_meta-1:0]			ctx_meta;


reg									rdreq_flowKIdx_info;
wire								empty_flowKIdx_info;
wire		[w_flowKIdx_info-1:0]	ctx_flowKIdx_info;


reg			[w_key-1:0]				flowKey_temp[1:0];
reg			[w_tcpFlag-1:0]			tcpFlag_temp;
reg									hit_temp;


reg 			[12:0]					pad13;



reg	[3:0]	state_searchFlowKTb;
parameter	IDLE_S				= 4'd0,
			READ_BUFFER_S	= 4'd1,
			WAIT_RAM_1_S		= 4'd2,
			WAIT_RAM_2_S		= 4'd3,
			READ_FLOWKTB_S	= 4'd4,
			ADD_A_FLOW_S	= 4'd5;




fifo meta_buffer(
.aclr(!reset),
.clock(clk),
.data(metadata_in),
.rdreq(rdreq_meta),
.wrreq(metadata_in_valid),
.empty(empty_meta),
.full(),
.q(ctx_meta),
.usedw()
);
defparam
	meta_buffer.width = w_meta,
	meta_buffer.depth = d_idxBuffer,
	meta_buffer.words = words_idxBuffer;


fifo flowKIdx_info_buffer(
.aclr(!reset),
.clock(clk),
.data(flowK_idx_info),
.rdreq(rdreq_flowKIdx_info),
.wrreq(flowK_idx_valid),
.empty(empty_flowKIdx_info),
.full(),
.q(ctx_flowKIdx_info),
.usedw()
);
defparam
	flowKIdx_info_buffer.width = w_flowKIdx_info,
	flowKIdx_info_buffer.depth = d_idxBuffer,
	flowKIdx_info_buffer.words = words_idxBuffer;

		


always @(posedge clk or negedge reset) begin
	if (!reset) begin
		rdreq_flowKIdx_info <= 1'b0;
		rdreq_meta <= 1'b0;
		conn_add_valid <= 1'b0;
		conn_add_info <= {w_connAdd_info{1'b0}};
		conn_idx_valid <= 1'b0;
		conn_idx_info <= {w_connIdx_info{1'b0}};
		rdValid_flowKTb <= 1'b0;
		idx_flowKTb <= {d_flowKTb{1'b0}};
		pull_freeFlowID_enable <= 1'b0;
		
		state_searchFlowKTb <= IDLE_S;
	end
	else begin
		case(state_searchFlowKTb)
			IDLE_S: begin
				conn_add_valid <=  1'b0;
				conn_idx_valid <= 1'b0;
				if(empty_flowKIdx_info == 1'b0) begin
					rdreq_flowKIdx_info <= 1'b1;
					rdreq_meta <= 1'b1;
					state_searchFlowKTb <= READ_BUFFER_S;
				end
				else begin
					state_searchFlowKTb <= IDLE_S;
				end
			end
			READ_BUFFER_S: begin
				rdreq_flowKIdx_info <= 1'b0;
				rdreq_meta <= 1'b0;
				{hit_temp, flowKey_temp[0], tcpFlag_temp} <= ctx_meta;
				{pad13, idx_flowKTb} <= ctx_flowKIdx_info;
				rdValid_flowKTb <= 1'b1;
				state_searchFlowKTb <= WAIT_RAM_1_S;
			end
			WAIT_RAM_1_S: begin
				rdValid_flowKTb <= 1'b0;
				state_searchFlowKTb <= WAIT_RAM_2_S;
				flowKey_temp[1] <= {
					flowKey_temp[0][b_protocol_key+w_proto-1:b_protocol_key], 
					flowKey_temp[0][b_srcPort_key+w_port-1:b_srcPort_key],
					flowKey_temp[0][b_dstPort_key+w_port-1:b_dstPort_key], 
					flowKey_temp[0][b_srcIP_key+w_ip-1:b_srcIP_key], 
					flowKey_temp[0][b_dstIP_key+w_ip-1:b_dstIP_key]};
			end
			WAIT_RAM_2_S: begin
				state_searchFlowKTb <= READ_FLOWKTB_S;
			end
			READ_FLOWKTB_S: begin
				if(idx_flowKTb == {d_flowKTb{1'b0}}) begin

					if((tcpFlag_temp == ONLY_SYN) && (hit_temp == 1'b1)) begin
						pull_freeFlowID_enable <= 1'b1;
						state_searchFlowKTb <= ADD_A_FLOW_S;
					end
					else begin
						state_searchFlowKTb <= IDLE_S;
						conn_idx_valid <= 1'b1;
						conn_idx_info <= {w_connIdx_info{1'b0}};
					end
				end
				else begin
					if(flowKey_temp[0] == ctx_flowKTb[b_flowK_flowKTb+w_key-1:
						b_flowK_flowKTb]) 
					begin
						conn_idx_valid <= 1'b1;
						conn_idx_info <= {1'b1,1'b0,1'b0,pad13,idx_flowKTb};
						state_searchFlowKTb <= IDLE_S;
					end
					else if(flowKey_temp[1] == ctx_flowKTb[b_flowK_flowKTb+w_key-1:
						b_flowK_flowKTb]) 
					begin
						conn_idx_valid <= 1'b1;
						conn_idx_info <= {1'b1,1'b0,1'b1,pad13,idx_flowKTb};
						state_searchFlowKTb <= IDLE_S;
					end
					else begin
						if(ctx_flowKTb[b_nextIdx_flowKTb+d_flowKTb-1:b_nextIdx_flowKTb] != {w_idx{1'b0}}) 
						begin

							idx_flowKTb <= ctx_flowKTb[b_nextIdx_flowKTb+d_flowKTb-1:
								b_nextIdx_flowKTb];
							rdValid_flowKTb <= 1'b1;
							state_searchFlowKTb <= WAIT_RAM_1_S;
						end
						else begin
							if((tcpFlag_temp == ONLY_SYN) && (hit_temp == 1'b1))begin
								pull_freeFlowID_enable <= 1'b1;
								state_searchFlowKTb <= ADD_A_FLOW_S;
							end
							else begin
								state_searchFlowKTb <= IDLE_S;
								conn_idx_valid <= 1'b1;
								conn_idx_info <= {w_connIdx_info{1'b0}};
							end
						end
					end
				end
			end
			ADD_A_FLOW_S: begin 

				pull_freeFlowID_enable <= 1'b0;
				conn_add_valid <= 1'b1;
				conn_add_info <= {flowKey_temp[0],free_flowID};
				conn_idx_valid <= 1'b1;
				conn_idx_info <=  {1'b0,1'b1,1'b0, free_flowID};
				state_searchFlowKTb <= IDLE_S;
			end
			default: begin
				state_searchFlowKTb <= IDLE_S;
			end
		endcase
	end
end

endmodule