Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combinatorial loop on s_block_int #297

Open
MikeOpenHWGroup opened this issue Feb 21, 2023 · 0 comments
Open

Combinatorial loop on s_block_int #297

MikeOpenHWGroup opened this issue Feb 21, 2023 · 0 comments
Labels
NextRelease Waived for CORE-V-MCU DevKit

Comments

@MikeOpenHWGroup
Copy link
Member

MikeOpenHWGroup commented Feb 21, 2023

Bug Description

In the apb_gpio module of CORE-V-MCU we have a couple of code blocks that are similar to the code snipit below. This implements a combinatorial loop on s_block_int and is very bad practise. In fact, I am not sure if synthesised gates match the behaviour of the RTL.

always_comb begin
    low =  low_in & ~s_block_int;
    hi  =  hi_in  & ~s_block_int;
end

always_ff @(posedge HCLK, negedge HRESETn) begin
    if (~HRESETn) begin
      s_block_int <= '0;
    end
    else begin
      s_block_int <= low | hi | s_block_int;
      PREADY <= 0;
      if (PSEL && PENABLE) begin  //APB WRITE
        if (PWRITE && ~PREADY) begin
            PREADY <= 1;
            case (PADDR[11:0])
              `REG_INTACK: begin
                s_block_int[PWDATA[7:0]] <= 0;
              end
              // more cases...
            endcase
        end
      end
   end
end // always_ff
@MikeOpenHWGroup MikeOpenHWGroup added the NextRelease Waived for CORE-V-MCU DevKit label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NextRelease Waived for CORE-V-MCU DevKit
Projects
None yet
Development

No branches or pull requests

1 participant