i2c8_sample.v

来自「I2c 总线测试程序,经过多次验证的.包括读写模式(第一次上传)」· Verilog 代码 · 共 79 行

V
79
字号
  wire SCL8_IN ;  wire SDA8_IN ;  wire SDA8_OUT;    wire SCL8,SDA8;  assign SCL8_IN = SCL8;  assign SDA8_IN = SDA8;  assign SDA8 = (SDA8_OUT==1'b0)? 1'b0:1'bz;    assign (pull1,pull0) SCL8 = 1'b1;  assign (pull1,pull0) SDA8 = 1'b1;    reg SCL8_M,SDA8_M;  reg [7:0] wdat8_tmp,rdat8_tmp,wdat8,rdat8;  reg ack8;  integer i8;    initial  begin    wdat8_tmp = 8'hzz;    rdat8_tmp = 8'h00;    wdat8 = 8'h00;    rdat8 = 8'h00;    ack8 = 1'b0;    SDA8_M = 1'bz;    SCL8_M = 1'bz;        # 10000;    //-------------------------------------        `include "./tb/i2c8/i2c8_start.v"        wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"        wdat8 = 8'h11; `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h22; `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h33; `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h44; `include "./tb/i2c8/i2c8_write_byte.v"        `include "./tb/i2c8/i2c8_stop.v"        //-------------------------------------        `include "./tb/i2c8/i2c8_start.v"        wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"        `include "./tb/i2c8/i2c8_stop.v"        `include "./tb/i2c8/i2c8_start.v"        wdat8 = 8'h01;    `include "./tb/i2c8/i2c8_write_byte.v"        repeat(3)    begin      `include "./tb/i2c8/i2c8_read_byte.v"    end        `include "./tb/i2c8/i2c8_read_last.v"        `include "./tb/i2c8/i2c8_stop.v"    //-------------------------------------        # 10000; $finish;  end    assign (strong1,strong0) SCL8 = SCL8_M;  assign (strong1,strong0) SDA8 = SDA8_M;    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?