// Demo 1: Manually instantiate a continuous pipeline of adders

// A parameterized module that adds N to inputs 32-bit input
module AddN#(
  parameter N = 1
)(
  input  wire[31:0] x,
  output wire[31:0] y
);

  assign y = x + N;

endmodule

// Program input
reg[31:0] v0 = 0;

// Instantiate a sequence of adders
wire[31:0] v1;
AddN#(1) add1(v0, v1);
wire[31:0] v2;
AddN#(2) add2(v1, v2);
wire[31:0] v3;
AddN#(3) add3(v2, v3);

// Things to try:
// 1. Print out the value of v3: should be 0 + 1 + 2 + 3 = 6
// 2. Change the value of v0 and print out the value of v3: should be v0 + 1 + 2 + 3 = v0 + 6
