Files
FPGA_DESIGN_IP/stream_rx_buffer/sim/func001/can_transceiver.sv
2026-03-06 16:22:17 +08:00

23 lines
356 B
Systemverilog

/*
can bus physical model by leguoqing
*/
module can_transceiver
(
output logic rxd = 1,
input logic txd,
inout tri1 line
);
always@(*)
if (line == 1'b0) rxd <= 1'b0;
else rxd <= 1'b1;
logic line_reg;
always@(*)
if (txd == 0) line_reg <= 0;
else line_reg <= 1;
assign line = line_reg ? 1'bz : 0;
endmodule