Advertisement
AlexanderAntonov

Untitled

Nov 2nd, 2022
874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module module_name (<ports declaration>);
  2. // stage 0 next-state logic
  3. <next-state register signals declaration>
  4. always @*
  5.     begin
  6.     st0_reg_next = in0 + in1;
  7.     …
  8.     end
  9.  
  10. // stage 0 register assignment logic
  11. <register signals declaration >
  12. always @(posedge clk_i)
  13.     begin
  14.     if (rst_i) begin st0_reg <= 0;end;     // clearing state on reset
  15.     else begin st0_reg <= st0_reg_next;end;    // registering next_state
  16.     end
  17.  
  18. // other stages
  19.  
  20. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement