Skip to content

Add Zbs single-bit operations implementation (RV32, SystemVerilog)#191

Open
jeff-7 wants to merge 35 commits into
mainfrom
zbs-implementation
Open

Add Zbs single-bit operations implementation (RV32, SystemVerilog)#191
jeff-7 wants to merge 35 commits into
mainfrom
zbs-implementation

Conversation

@jeff-7

@jeff-7 jeff-7 commented Mar 3, 2026

Copy link
Copy Markdown

Implements RV32 Zbs single-bit operations:

  • bclr / bclri
  • bset / bseti
  • binv / binvi
  • bext / bexti

Design follows abstract ALU pattern:

  • Module remains purely functional
  • R/I distinction handled in decoder
  • Uses SystemVerilog style (logic, always_comb)

@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown

🔧 DE1-SoC Synthesis Report Summary Diff

  • RV32I

    1. Fitter Summary

      @@ -1,11 +1,11 @@
      -Fitter Status : Successful - Sun Jul 19 20:27:50 2026
      +Fitter Status : Successful - Wed Jul 22 06:48:52 2026
       Quartus Prime Version : 25.1std.0 Build 1129 10/21/2025 SC Lite Edition
       Revision Name : utoss-risc-v
       Top-level Entity Name : top
       Family : Cyclone V
       Device : 5CSEMA5F31C6
       Timing Models : Final
      -Logic utilization (in ALMs) : 1,522 / 32,070 ( 5 % )
      +Logic utilization (in ALMs) : 1,519 / 32,070 ( 5 % )
       Total registers : 1566
       Total pins : 15 / 457 ( 3 % )
       Total virtual pins : 0
    2. Fitter by entity

      @@ -1,6 +1,6 @@
       Compilation Hierarchy Node                        ALMs needed [=A-B+C]  [A] ALMs used in final placement  [B] Estimate of ALMs recoverable by dense packing  [C] Estimate of ALMs unavailable  ALMs used for memory  Combinational ALUTs  Dedicated Logic Registers  I/O Registers  Block Memory Bits  M10Ks  DSP Blocks  Pins  Virtual Pins  Full Hierarchy Name                                                                                                Entity Name         Library Name
      -|top                                              1521.5 (0.5)          1661.0 (0.5)                      164.0 (0.0)                                        24.5 (0.0)                        0.0 (0.0)             1777 (1)             1566 (0)                   0 (0)          32768              8      0           15    0             |top                                                                                                               top                 work
      -   |memory_map:memory_map|                        10.8 (10.8)           11.3 (11.3)                       0.5 (0.5)                                          0.0 (0.0)                         0.0 (0.0)             13 (13)              11 (11)                    0 (0)          32768              8      0           0     0             |top|memory_map:memory_map                                                                                         memory_map          work
      +|top                                              1519.0 (0.5)          1653.5 (0.5)                      163.0 (0.0)                                        28.5 (0.0)                        0.0 (0.0)             1777 (1)             1566 (0)                   0 (0)          32768              8      0           15    0             |top                                                                                                               top                 work
      +   |memory_map:memory_map|                        11.2 (11.2)           12.4 (12.4)                       1.2 (1.2)                                          0.0 (0.0)                         0.0 (0.0)             13 (13)              11 (11)                    0 (0)          32768              8      0           0     0             |top|memory_map:memory_map                                                                                         memory_map          work
             |altsyncram:M0_rtl_0|                       0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M0_rtl_0                                                                     altsyncram          work
                |altsyncram_9hp1:auto_generated|         0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M0_rtl_0|altsyncram_9hp1:auto_generated                                      altsyncram_9hp1     work
             |altsyncram:M0_rtl_1|                       0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M0_rtl_1                                                                     altsyncram          work
      @@ -17,16 +17,16 @@
                |altsyncram_chp1:auto_generated|         0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M3_rtl_0|altsyncram_chp1:auto_generated                                      altsyncram_chp1     work
             |altsyncram:M3_rtl_1|                       0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M3_rtl_1                                                                     altsyncram          work
                |altsyncram_chp1:auto_generated|         0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M3_rtl_1|altsyncram_chp1:auto_generated                                      altsyncram_chp1     work
      -   |utoss_riscv:core|                             1510.2 (591.8)        1649.2 (608.4)                    163.5 (25.0)                                       24.5 (8.4)                        0.0 (0.0)             1763 (684)           1555 (465)                 0 (0)          0                  0      0           0     0             |top|utoss_riscv:core                                                                                              utoss_riscv         work
      -      |decode_stage:u_decode_stage|               323.0 (3.5)           412.2 (3.7)                       89.7 (0.2)                                         0.5 (0.0)                         0.0 (0.0)             111 (8)              992 (0)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage                                                                  decode_stage        work
      -         |Instruction_Decode:instruction_decode|  21.4 (19.9)           22.2 (20.7)                       0.8 (0.8)                                          0.0 (0.0)                         0.0 (0.0)             59 (56)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode                            Instruction_Decode  work
      -            |ALUdecoder:instanceALUDec|           1.5 (1.5)             1.5 (1.5)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode|ALUdecoder:instanceALUDec  ALUdecoder          work
      -         |control_fsm:u_ctrl|                     0.8 (0.8)             1.0 (1.0)                         0.2 (0.2)                                          0.0 (0.0)                         0.0 (0.0)             4 (4)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|control_fsm:u_ctrl                                               control_fsm         work
      -         |registerFile:RegFile|                   297.3 (297.3)         385.3 (385.3)                     88.5 (88.5)                                        0.5 (0.5)                         0.0 (0.0)             40 (40)              992 (992)                  0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|registerFile:RegFile                                             registerFile        work
      -      |execute_stage:u_execute_stage|             446.2 (102.7)         449.6 (107.5)                     16.7 (5.7)                                         13.3 (0.9)                        0.0 (0.0)             672 (194)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage                                                                execute_stage       work
      -         |ALU:alu|                                343.5 (343.5)         342.1 (342.1)                     11.0 (11.0)                                        12.4 (12.4)                       0.0 (0.0)             478 (478)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage|ALU:alu                                                        ALU                 work
      -      |fetch_stage:u_fetch_stage|                 71.1 (71.1)           92.8 (92.8)                       23.7 (23.7)                                        1.9 (1.9)                         0.0 (0.0)             125 (125)            97 (97)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|fetch_stage:u_fetch_stage                                                                    fetch_stage         work
      -      |hazard_unit:u_hazard_unit|                 5.7 (5.7)             7.0 (7.0)                         1.3 (1.3)                                          0.0 (0.0)                         0.0 (0.0)             15 (15)              1 (1)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|hazard_unit:u_hazard_unit                                                                    hazard_unit         work
      -      |memory_stage:u_memory_stage|               12.2 (12.2)           12.7 (12.7)                       0.8 (0.8)                                          0.4 (0.4)                         0.0 (0.0)             27 (27)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|memory_stage:u_memory_stage                                                                  memory_stage        work
      -      |write_back_stage:u_write_back_stage|       60.2 (58.3)           66.5 (64.0)                       6.3 (5.7)                                          0.0 (0.0)                         0.0 (0.0)             129 (126)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage                                                          write_back_stage    work
      -         |MemoryLoader:memory_loader|             1.8 (1.8)             2.5 (2.5)                         0.7 (0.7)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage|MemoryLoader:memory_loader                               MemoryLoader        work
      +   |utoss_riscv:core|                             1507.3 (590.1)        1640.6 (610.6)                    161.7 (28.2)                                       28.5 (7.6)                        0.0 (0.0)             1763 (683)           1555 (465)                 0 (0)          0                  0      0           0     0             |top|utoss_riscv:core                                                                                              utoss_riscv         work
      +      |decode_stage:u_decode_stage|               319.5 (3.6)           401.6 (3.8)                       83.7 (0.2)                                         1.6 (0.0)                         0.0 (0.0)             112 (8)              992 (0)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage                                                                  decode_stage        work
      +         |Instruction_Decode:instruction_decode|  21.3 (20.2)           21.9 (20.8)                       0.6 (0.6)                                          0.0 (0.0)                         0.0 (0.0)             61 (58)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode                            Instruction_Decode  work
      +            |ALUdecoder:instanceALUDec|           1.2 (1.2)             1.2 (1.2)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode|ALUdecoder:instanceALUDec  ALUdecoder          work
      +         |control_fsm:u_ctrl|                     0.7 (0.7)             0.9 (0.9)                         0.2 (0.2)                                          0.1 (0.1)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|control_fsm:u_ctrl                                               control_fsm         work
      +         |registerFile:RegFile|                   293.8 (293.8)         374.9 (374.9)                     82.6 (82.6)                                        1.5 (1.5)                         0.0 (0.0)             40 (40)              992 (992)                  0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|registerFile:RegFile                                             registerFile        work
      +      |execute_stage:u_execute_stage|             443.8 (100.9)         452.9 (108.3)                     22.7 (7.8)                                         13.6 (0.4)                        0.0 (0.0)             672 (194)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage                                                                execute_stage       work
      +         |ALU:alu|                                342.9 (342.9)         344.6 (344.6)                     14.9 (14.9)                                        13.2 (13.2)                       0.0 (0.0)             478 (478)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage|ALU:alu                                                        ALU                 work
      +      |fetch_stage:u_fetch_stage|                 74.7 (74.7)           91.3 (91.3)                       22.2 (22.2)                                        5.5 (5.5)                         0.0 (0.0)             125 (125)            97 (97)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|fetch_stage:u_fetch_stage                                                                    fetch_stage         work
      +      |hazard_unit:u_hazard_unit|                 6.1 (6.1)             6.8 (6.8)                         0.7 (0.7)                                          0.0 (0.0)                         0.0 (0.0)             15 (15)              1 (1)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|hazard_unit:u_hazard_unit                                                                    hazard_unit         work
      +      |memory_stage:u_memory_stage|               11.4 (11.4)           11.4 (11.4)                       0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             27 (27)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|memory_stage:u_memory_stage                                                                  memory_stage        work
      +      |write_back_stage:u_write_back_stage|       61.2 (59.5)           66.0 (63.8)                       4.9 (4.4)                                          0.1 (0.1)                         0.0 (0.0)             129 (126)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage                                                          write_back_stage    work
      +         |MemoryLoader:memory_loader|             1.7 (1.7)             2.2 (2.2)                         0.5 (0.5)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage|MemoryLoader:memory_loader                               MemoryLoader        work
    3. Timing

      @@ -3,11 +3,11 @@
       ------------------------------------------------------------
       
       Type  : Slow 1100mV 85C Model Setup 'CLOCK_50'
      -Slack : 2.474
      +Slack : 2.957
       TNS   : 0.000
       
       Type  : Slow 1100mV 85C Model Hold 'CLOCK_50'
      -Slack : 0.338
      +Slack : 0.325
       TNS   : 0.000
       
       Type  : Slow 1100mV 85C Model Minimum Pulse Width 'CLOCK_50'
      @@ -15,11 +15,11 @@
       TNS   : 0.000
       
       Type  : Slow 1100mV 0C Model Setup 'CLOCK_50'
      -Slack : 3.122
      +Slack : 3.415
       TNS   : 0.000
       
       Type  : Slow 1100mV 0C Model Hold 'CLOCK_50'
      -Slack : 0.326
      +Slack : 0.318
       TNS   : 0.000
       
       Type  : Slow 1100mV 0C Model Minimum Pulse Width 'CLOCK_50'
      @@ -27,27 +27,27 @@
       TNS   : 0.000
       
       Type  : Fast 1100mV 85C Model Setup 'CLOCK_50'
      -Slack : 9.095
      +Slack : 9.623
       TNS   : 0.000
       
       Type  : Fast 1100mV 85C Model Hold 'CLOCK_50'
      -Slack : 0.190
      +Slack : 0.187
       TNS   : 0.000
       
       Type  : Fast 1100mV 85C Model Minimum Pulse Width 'CLOCK_50'
      -Slack : 8.783
      +Slack : 8.784
       TNS   : 0.000
       
       Type  : Fast 1100mV 0C Model Setup 'CLOCK_50'
      -Slack : 10.320
      +Slack : 10.702
       TNS   : 0.000
       
       Type  : Fast 1100mV 0C Model Hold 'CLOCK_50'
      -Slack : 0.172
      +Slack : 0.166
       TNS   : 0.000
       
       Type  : Fast 1100mV 0C Model Minimum Pulse Width 'CLOCK_50'
      -Slack : 8.777
      +Slack : 8.778
       TNS   : 0.000
       
       ------------------------------------------------------------
  • RV32IB

    1. Fitter Summary

      @@ -1,11 +1,11 @@
      -Fitter Status : Successful - Sun Jul 19 20:28:55 2026
      +Fitter Status : Successful - Wed Jul 22 06:48:01 2026
       Quartus Prime Version : 25.1std.0 Build 1129 10/21/2025 SC Lite Edition
       Revision Name : utoss-risc-v
       Top-level Entity Name : top
       Family : Cyclone V
       Device : 5CSEMA5F31C6
       Timing Models : Final
      -Logic utilization (in ALMs) : 1,522 / 32,070 ( 5 % )
      +Logic utilization (in ALMs) : 1,519 / 32,070 ( 5 % )
       Total registers : 1566
       Total pins : 15 / 457 ( 3 % )
       Total virtual pins : 0
    2. Fitter by entity

      @@ -1,6 +1,6 @@
       Compilation Hierarchy Node                        ALMs needed [=A-B+C]  [A] ALMs used in final placement  [B] Estimate of ALMs recoverable by dense packing  [C] Estimate of ALMs unavailable  ALMs used for memory  Combinational ALUTs  Dedicated Logic Registers  I/O Registers  Block Memory Bits  M10Ks  DSP Blocks  Pins  Virtual Pins  Full Hierarchy Name                                                                                                Entity Name         Library Name
      -|top                                              1521.5 (0.5)          1661.0 (0.5)                      164.0 (0.0)                                        24.5 (0.0)                        0.0 (0.0)             1777 (1)             1566 (0)                   0 (0)          32768              8      0           15    0             |top                                                                                                               top                 work
      -   |memory_map:memory_map|                        10.8 (10.8)           11.3 (11.3)                       0.5 (0.5)                                          0.0 (0.0)                         0.0 (0.0)             13 (13)              11 (11)                    0 (0)          32768              8      0           0     0             |top|memory_map:memory_map                                                                                         memory_map          work
      +|top                                              1519.0 (0.5)          1653.5 (0.5)                      163.0 (0.0)                                        28.5 (0.0)                        0.0 (0.0)             1777 (1)             1566 (0)                   0 (0)          32768              8      0           15    0             |top                                                                                                               top                 work
      +   |memory_map:memory_map|                        11.2 (11.2)           12.4 (12.4)                       1.2 (1.2)                                          0.0 (0.0)                         0.0 (0.0)             13 (13)              11 (11)                    0 (0)          32768              8      0           0     0             |top|memory_map:memory_map                                                                                         memory_map          work
             |altsyncram:M0_rtl_0|                       0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M0_rtl_0                                                                     altsyncram          work
                |altsyncram_9hp1:auto_generated|         0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M0_rtl_0|altsyncram_9hp1:auto_generated                                      altsyncram_9hp1     work
             |altsyncram:M0_rtl_1|                       0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M0_rtl_1                                                                     altsyncram          work
      @@ -17,16 +17,16 @@
                |altsyncram_chp1:auto_generated|         0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M3_rtl_0|altsyncram_chp1:auto_generated                                      altsyncram_chp1     work
             |altsyncram:M3_rtl_1|                       0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M3_rtl_1                                                                     altsyncram          work
                |altsyncram_chp1:auto_generated|         0.0 (0.0)             0.0 (0.0)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             0 (0)                0 (0)                      0 (0)          4096               1      0           0     0             |top|memory_map:memory_map|altsyncram:M3_rtl_1|altsyncram_chp1:auto_generated                                      altsyncram_chp1     work
      -   |utoss_riscv:core|                             1510.2 (591.8)        1649.2 (608.4)                    163.5 (25.0)                                       24.5 (8.4)                        0.0 (0.0)             1763 (684)           1555 (465)                 0 (0)          0                  0      0           0     0             |top|utoss_riscv:core                                                                                              utoss_riscv         work
      -      |decode_stage:u_decode_stage|               323.0 (3.5)           412.2 (3.7)                       89.7 (0.2)                                         0.5 (0.0)                         0.0 (0.0)             111 (8)              992 (0)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage                                                                  decode_stage        work
      -         |Instruction_Decode:instruction_decode|  21.4 (19.9)           22.2 (20.7)                       0.8 (0.8)                                          0.0 (0.0)                         0.0 (0.0)             59 (56)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode                            Instruction_Decode  work
      -            |ALUdecoder:instanceALUDec|           1.5 (1.5)             1.5 (1.5)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode|ALUdecoder:instanceALUDec  ALUdecoder          work
      -         |control_fsm:u_ctrl|                     0.8 (0.8)             1.0 (1.0)                         0.2 (0.2)                                          0.0 (0.0)                         0.0 (0.0)             4 (4)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|control_fsm:u_ctrl                                               control_fsm         work
      -         |registerFile:RegFile|                   297.3 (297.3)         385.3 (385.3)                     88.5 (88.5)                                        0.5 (0.5)                         0.0 (0.0)             40 (40)              992 (992)                  0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|registerFile:RegFile                                             registerFile        work
      -      |execute_stage:u_execute_stage|             446.2 (102.7)         449.6 (107.5)                     16.7 (5.7)                                         13.3 (0.9)                        0.0 (0.0)             672 (194)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage                                                                execute_stage       work
      -         |ALU:alu|                                343.5 (343.5)         342.1 (342.1)                     11.0 (11.0)                                        12.4 (12.4)                       0.0 (0.0)             478 (478)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage|ALU:alu                                                        ALU                 work
      -      |fetch_stage:u_fetch_stage|                 71.1 (71.1)           92.8 (92.8)                       23.7 (23.7)                                        1.9 (1.9)                         0.0 (0.0)             125 (125)            97 (97)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|fetch_stage:u_fetch_stage                                                                    fetch_stage         work
      -      |hazard_unit:u_hazard_unit|                 5.7 (5.7)             7.0 (7.0)                         1.3 (1.3)                                          0.0 (0.0)                         0.0 (0.0)             15 (15)              1 (1)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|hazard_unit:u_hazard_unit                                                                    hazard_unit         work
      -      |memory_stage:u_memory_stage|               12.2 (12.2)           12.7 (12.7)                       0.8 (0.8)                                          0.4 (0.4)                         0.0 (0.0)             27 (27)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|memory_stage:u_memory_stage                                                                  memory_stage        work
      -      |write_back_stage:u_write_back_stage|       60.2 (58.3)           66.5 (64.0)                       6.3 (5.7)                                          0.0 (0.0)                         0.0 (0.0)             129 (126)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage                                                          write_back_stage    work
      -         |MemoryLoader:memory_loader|             1.8 (1.8)             2.5 (2.5)                         0.7 (0.7)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage|MemoryLoader:memory_loader                               MemoryLoader        work
      +   |utoss_riscv:core|                             1507.3 (590.1)        1640.6 (610.6)                    161.7 (28.2)                                       28.5 (7.6)                        0.0 (0.0)             1763 (683)           1555 (465)                 0 (0)          0                  0      0           0     0             |top|utoss_riscv:core                                                                                              utoss_riscv         work
      +      |decode_stage:u_decode_stage|               319.5 (3.6)           401.6 (3.8)                       83.7 (0.2)                                         1.6 (0.0)                         0.0 (0.0)             112 (8)              992 (0)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage                                                                  decode_stage        work
      +         |Instruction_Decode:instruction_decode|  21.3 (20.2)           21.9 (20.8)                       0.6 (0.6)                                          0.0 (0.0)                         0.0 (0.0)             61 (58)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode                            Instruction_Decode  work
      +            |ALUdecoder:instanceALUDec|           1.2 (1.2)             1.2 (1.2)                         0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|Instruction_Decode:instruction_decode|ALUdecoder:instanceALUDec  ALUdecoder          work
      +         |control_fsm:u_ctrl|                     0.7 (0.7)             0.9 (0.9)                         0.2 (0.2)                                          0.1 (0.1)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|control_fsm:u_ctrl                                               control_fsm         work
      +         |registerFile:RegFile|                   293.8 (293.8)         374.9 (374.9)                     82.6 (82.6)                                        1.5 (1.5)                         0.0 (0.0)             40 (40)              992 (992)                  0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|decode_stage:u_decode_stage|registerFile:RegFile                                             registerFile        work
      +      |execute_stage:u_execute_stage|             443.8 (100.9)         452.9 (108.3)                     22.7 (7.8)                                         13.6 (0.4)                        0.0 (0.0)             672 (194)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage                                                                execute_stage       work
      +         |ALU:alu|                                342.9 (342.9)         344.6 (344.6)                     14.9 (14.9)                                        13.2 (13.2)                       0.0 (0.0)             478 (478)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|execute_stage:u_execute_stage|ALU:alu                                                        ALU                 work
      +      |fetch_stage:u_fetch_stage|                 74.7 (74.7)           91.3 (91.3)                       22.2 (22.2)                                        5.5 (5.5)                         0.0 (0.0)             125 (125)            97 (97)                    0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|fetch_stage:u_fetch_stage                                                                    fetch_stage         work
      +      |hazard_unit:u_hazard_unit|                 6.1 (6.1)             6.8 (6.8)                         0.7 (0.7)                                          0.0 (0.0)                         0.0 (0.0)             15 (15)              1 (1)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|hazard_unit:u_hazard_unit                                                                    hazard_unit         work
      +      |memory_stage:u_memory_stage|               11.4 (11.4)           11.4 (11.4)                       0.0 (0.0)                                          0.0 (0.0)                         0.0 (0.0)             27 (27)              0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|memory_stage:u_memory_stage                                                                  memory_stage        work
      +      |write_back_stage:u_write_back_stage|       61.2 (59.5)           66.0 (63.8)                       4.9 (4.4)                                          0.1 (0.1)                         0.0 (0.0)             129 (126)            0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage                                                          write_back_stage    work
      +         |MemoryLoader:memory_loader|             1.7 (1.7)             2.2 (2.2)                         0.5 (0.5)                                          0.0 (0.0)                         0.0 (0.0)             3 (3)                0 (0)                      0 (0)          0                  0      0           0     0             |top|utoss_riscv:core|write_back_stage:u_write_back_stage|MemoryLoader:memory_loader                               MemoryLoader        work
    3. Timing

      @@ -3,11 +3,11 @@
       ------------------------------------------------------------
       
       Type  : Slow 1100mV 85C Model Setup 'CLOCK_50'
      -Slack : 2.474
      +Slack : 2.957
       TNS   : 0.000
       
       Type  : Slow 1100mV 85C Model Hold 'CLOCK_50'
      -Slack : 0.338
      +Slack : 0.325
       TNS   : 0.000
       
       Type  : Slow 1100mV 85C Model Minimum Pulse Width 'CLOCK_50'
      @@ -15,11 +15,11 @@
       TNS   : 0.000
       
       Type  : Slow 1100mV 0C Model Setup 'CLOCK_50'
      -Slack : 3.122
      +Slack : 3.415
       TNS   : 0.000
       
       Type  : Slow 1100mV 0C Model Hold 'CLOCK_50'
      -Slack : 0.326
      +Slack : 0.318
       TNS   : 0.000
       
       Type  : Slow 1100mV 0C Model Minimum Pulse Width 'CLOCK_50'
      @@ -27,27 +27,27 @@
       TNS   : 0.000
       
       Type  : Fast 1100mV 85C Model Setup 'CLOCK_50'
      -Slack : 9.095
      +Slack : 9.623
       TNS   : 0.000
       
       Type  : Fast 1100mV 85C Model Hold 'CLOCK_50'
      -Slack : 0.190
      +Slack : 0.187
       TNS   : 0.000
       
       Type  : Fast 1100mV 85C Model Minimum Pulse Width 'CLOCK_50'
      -Slack : 8.783
      +Slack : 8.784
       TNS   : 0.000
       
       Type  : Fast 1100mV 0C Model Setup 'CLOCK_50'
      -Slack : 10.320
      +Slack : 10.702
       TNS   : 0.000
       
       Type  : Fast 1100mV 0C Model Hold 'CLOCK_50'
      -Slack : 0.172
      +Slack : 0.166
       TNS   : 0.000
       
       Type  : Fast 1100mV 0C Model Minimum Pulse Width 'CLOCK_50'
      -Slack : 8.777
      +Slack : 8.778
       TNS   : 0.000
       
       ------------------------------------------------------------

Comparing synthesis results from main branch vs. this PR

@TheDeepestSpace TheDeepestSpace linked an issue Mar 3, 2026 that may be closed by this pull request
@TheDeepestSpace

Copy link
Copy Markdown
Member

Thanks for the PR! Let us merge #190 first, so that you can use the b_alu_control_t from it

Comment thread src/ext/b/zbs.sv Outdated
Comment on lines +1 to +13
// Zbs: Single-Bit Operations (RV32)
//
// Implements:
// - bclr / bclri
// - bset / bseti
// - binv / binvi
// - bext / bexti
//
// Design note:
// - Purely combinational ALU block
// - reg2[4:0] used as bit index
// - R/I distinction handled in decoder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the documentation here I would just specify the section of the specification that corresponds to Zbs extension

Comment thread src/ext/b/zbs.sv Outdated
@TheDeepestSpace

Copy link
Copy Markdown
Member

Just merged #190 , please rebase onto latest main so you can use b_alu_control_t !

@TheDeepestSpace

Copy link
Copy Markdown
Member

hey @Dazhou-20383 i brought this up to date a bit. since we've released the integration for B extension already, we need to implement the Zbs decoder as part of this PR to make sure it works with the rest of the core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Zbs sub-extension ALU

3 participants