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

Regression From 3244683 #117

Closed
peteut opened this issue Jun 30, 2019 · 0 comments
Closed

Regression From 3244683 #117

peteut opened this issue Jun 30, 2019 · 0 comments
Labels
Milestone

Comments

@peteut
Copy link
Contributor

peteut commented Jun 30, 2019

I'm observing a regression introduced by 3244683 using Array.

Good, w/ 3244683 reverted:

  always @* begin
    \$next\set_cmd  = 24'h000000;
    casez (reg_cnt__reg[2:0])
      3'h0:
          casez (unit_cnt__reg)
            2'h0:
                \$next\set_cmd  = { 8'h30, input_0_0 };
            2'h1:
                \$next\set_cmd  = { 8'h30, input_1_0 };
            2'hz:
                \$next\set_cmd  = { 8'h30, input_2_0 };
          endcase
      3'h1:
          casez (unit_cnt__reg)
            2'h0:
                \$next\set_cmd  = { 8'h31, input_0_1 };
            2'h1:
                \$next\set_cmd  = { 8'h31, input_1_1 };
            2'hz:
                \$next\set_cmd  = { 8'h31, input_2_1 };
          endcase
      3'h2:
          casez (unit_cnt__reg)
            2'h0:
                \$next\set_cmd  = { 8'h32, input_0_2 };
            2'h1:
                \$next\set_cmd  = { 8'h32, input_1_2 };
            2'hz:
                \$next\set_cmd  = { 8'h32, input_2_2 };
          endcase
      3'h3:
          casez (unit_cnt__reg)
            2'h0:
                \$next\set_cmd  = { 8'h33, input_0_3 };
            2'h1:
                \$next\set_cmd  = { 8'h33, input_1_3 };
            2'hz:
                \$next\set_cmd  = { 8'h33, input_2_3 };                                                                                                                                                                                                                                                                                                                                    
          endcase                                                                                                                                                                                                                                                                                                                                                                          
      3'h4:                                                                                                                                                                                                                                                                                                                                                                                
          casez (unit_cnt__reg)                                                                                                                                                                                                                                                                                                                                                            
            2'h0:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h34, input_0_4 };                                                                                                                                                                                                                                                                                                                                    
            2'h1:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h34, input_1_4 };                                                                                                                                                                                                                                                                                                                                    
            2'hz:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h34, input_2_4 };                                                                                                                                                                                                                                                                                                                                    
          endcase                                                                                                                                                                                                                                                                                                                                                                          
      3'h5:                                                                                                                                                                                                                                                                                                                                                                                
          casez (unit_cnt__reg)                                                                                                                                                                                                                                                                                                                                                            
            2'h0:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h35, input_0_5 };                                                                                                                                                                                                                                                                                                                                    
            2'h1:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h35, input_1_5 };                                                                                                                                                                                                                                                                                                                                    
            2'hz:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h35, input_2_5 };                                                                                                                                                                                                                                                                                                                                    
          endcase                                                                                                                                                                                                                                                                                                                                                                          
      3'h6:                                                                                                                                                                                                                                                                                                                                                                                
          casez (unit_cnt__reg)                                                                                                                                                                                                                                                                                                                                                            
            2'h0:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h36, input_0_6 };                                                                                                                                                                                                                                                                                                                                    
            2'h1:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h36, input_1_6 };                                                                                                                                                                                                                                                                                                                                    
            2'hz:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h36, input_2_6 };                                                                                                                                                                                                                                                                                                                                    
          endcase                                                                                                                                                                                                                                                                                                                                                                          
      3'hz:                                                                                                                                                                                                                                                                                                                                                                                
          casez (unit_cnt__reg)                                                                                                                                                                                                                                                                                                                                                            
            2'h0:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h37, input_0_7 };                                                                                                                                                                                                                                                                                                                                    
            2'h1:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h37, input_1_7 };                                                                                                                                                                                                                                                                                                                                    
            2'hz:                                                                                                                                                                                                                                                                                                                                                                          
                \$next\set_cmd  = { 8'h37, input_2_7 };                                                                                                                                                                                                                                                                                                                                    
          endcase                                                                                                                                                                                                                                                                                                                                                                          
    endcase                                                                                                                                                                                                                                                                                                                                                                                
  end 

NOK, w/ 3244683:

  always @* begin
    \$next\set_cmd  = 24'h000000;
    casez (reg_cnt__reg[2:0])
      1'h0, 1'h0, 1'h0:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h30, input_0_0 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h30, input_1_0 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h30, input_2_0 };
          endcase
      1'h0, 1'h0, 1'h1:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h31, input_0_1 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h31, input_1_1 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h31, input_2_1 };
          endcase
      1'h0, 1'h1, 1'h0:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h32, input_0_2 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h32, input_1_2 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h32, input_2_2 };
          endcase
      1'h0, 1'h1, 1'h1:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h33, input_0_3 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h33, input_1_3 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h33, input_2_3 };
          endcase
      1'h1, 1'h0, 1'h0:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h34, input_0_4 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h34, input_1_4 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h34, input_2_4 };
          endcase
      1'h1, 1'h0, 1'h1:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h35, input_0_5 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h35, input_1_5 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h35, input_2_5 };
          endcase
      1'h1, 1'h1, 1'h0:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h36, input_0_6 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h36, input_1_6 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h36, input_2_6 };
          endcase
      1'hz, 1'hz, 1'hz:
          casez (unit_cnt__reg)
            1'h0, 1'h0:
                \$next\set_cmd  = { 8'h37, input_0_7 };
            1'h0, 1'h1:
                \$next\set_cmd  = { 8'h37, input_1_7 };
            1'hz, 1'hz:
                \$next\set_cmd  = { 8'h37, input_2_7 };
          endcase
    endcase
  end
$ yosys -V
Yosys 0.8+576 (git sha1 dd8d264b, clang 3.8.1-24 -O3 -DNDEBUG -fPIC)

Note that yosys asserts if NDEBUG is not set.

The DSL snippet is:

        unit_idx = unit_cnt.reg[:bits_for(self.n_units - 1)]
        reg_idx = reg_cnt.reg[:bits_for(N_CH - 1)]

        m.d.comb += \
            set_cmd.eq(encode_set_cmd(
                self.input_reg[unit_idx][reg_idx], reg_cnt.reg[:-1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants