Skip to content

Commit

Permalink
remove synchronizers
Browse files Browse the repository at this point in the history
  • Loading branch information
NouranAbdelaziz committed Aug 11, 2024
1 parent e05c0e7 commit 43965e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 50 deletions.
28 changes: 2 additions & 26 deletions hdl/rtl/bus_wrappers/EF_I2C_APB.pp.v
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,6 @@ module EF_I2C_APB # (
(PADDR[15:0] == GCLK_REG_ADDR) ? {23'b0, GCLK_REG} :
32'hDEADBEEF;


reg [0:0] _scl_i_reg_[1:0];
wire _scl_i_w_ = _scl_i_reg_[1];
always@(posedge PCLK or negedge PRESETn)
if(PRESETn == 0) begin
_scl_i_reg_[0] <= 'b0;
_scl_i_reg_[1] <= 'b0;
end
else begin
_scl_i_reg_[0] <= scl_i;
_scl_i_reg_[1] <= _scl_i_reg_[0];
end

reg [0:0] _sda_i_reg_[1:0];
wire _sda_i_w_ = _sda_i_reg_[1];
always@(posedge PCLK or negedge PRESETn)
if(PRESETn == 0) begin
_sda_i_reg_[0] <= 'b0;
_sda_i_reg_[1] <= 'b0;
end
else begin
_sda_i_reg_[0] <= sda_i;
_sda_i_reg_[1] <= _sda_i_reg_[0];
end

i2c_master_wbs_16 #
(
Expand Down Expand Up @@ -175,10 +151,10 @@ module EF_I2C_APB # (
.wbs_cyc_i(wbs_cyc_i), // CYC_I cycle input

// I2C interface
.i2c_scl_i(_scl_i_w_),
.i2c_scl_i(scl_i),
.i2c_scl_o(scl_o),
.i2c_scl_t(scl_oen_o),
.i2c_sda_i(_sda_i_w_),
.i2c_sda_i(sda_i),
.i2c_sda_o(sda_o),
.i2c_sda_t(sda_oen_o),

Expand Down
26 changes: 2 additions & 24 deletions hdl/rtl/bus_wrappers/EF_I2C_APB.v
Original file line number Diff line number Diff line change
Expand Up @@ -133,29 +133,7 @@ module EF_I2C_APB # (
(PADDR[15:0] == GCLK_REG_ADDR) ? {23'b0, GCLK_REG} :
32'hDEADBEEF;

reg [0:0] _scl_i_reg_[1:0];
wire _scl_i_w_ = _scl_i_reg_[1];
always@(posedge PCLK or negedge PRESETn)
if(PRESETn == 0) begin
_scl_i_reg_[0] <= 'b0;
_scl_i_reg_[1] <= 'b0;
end
else begin
_scl_i_reg_[0] <= scl_i;
_scl_i_reg_[1] <= _scl_i_reg_[0];
end

reg [0:0] _sda_i_reg_[1:0];
wire _sda_i_w_ = _sda_i_reg_[1];
always@(posedge PCLK or negedge PRESETn)
if(PRESETn == 0) begin
_sda_i_reg_[0] <= 'b0;
_sda_i_reg_[1] <= 'b0;
end
else begin
_sda_i_reg_[0] <= sda_i;
_sda_i_reg_[1] <= _sda_i_reg_[0];
end
i2c_master_wbs_16 #
(
.DEFAULT_PRESCALE(DEFAULT_PRESCALE),
Expand Down Expand Up @@ -184,10 +162,10 @@ module EF_I2C_APB # (
.wbs_cyc_i(wbs_cyc_i), // CYC_I cycle input

// I2C interface
.i2c_scl_i(_scl_i_w_),
.i2c_scl_i(scl_i),
.i2c_scl_o(scl_o),
.i2c_scl_t(scl_oen_o),
.i2c_sda_i(_sda_i_w_),
.i2c_sda_i(sda_i),
.i2c_sda_o(sda_o),
.i2c_sda_t(sda_oen_o),

Expand Down

0 comments on commit 43965e6

Please sign in to comment.