Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
module switch (
input clk,
input reset,
input [7:0] data,
input valid,
output logic [7:0] port0,
output logic [7:0] port1,
output logic ready_0,
output logic ready_1,
output logic packet_error_0,
output logic packet_error_1
);
//logic next_error_0 =
//logic next_error_1 =
//need to add that if there is an error, the ready flag should be down.
(atleast 2 cycles between ready goes down and another ready comes up)
//Create a wire that calculate PS, Than, compare it to the PS in the packet
logic ps;
if (is_da)
begin
if (data == 8'd0)
begin
ready_0 <= 1'd1;
port_0 <= data;
end
if (data == 8'd1)
begin
ready_1 <= 1'd1;
port_1 <= data;
end
end
if (in_length)
begin
length <= data;
end