首次提交
This commit is contained in:
22
stream_rx_ctrl/sim/func001/can_transceiver.sv
Normal file
22
stream_rx_ctrl/sim/func001/can_transceiver.sv
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
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
|
||||
Reference in New Issue
Block a user