Loading

Paste #pekoakr2m

  1. /* Generated by Yosys 0.8+67 (git sha1 d5c9d053, clang 6.0.1-9.2 -fPIC -Os) */
  2.  
  3. (* generator = "nMigen" *)
  4. module add(b, o, a);
  5.   wire [16:0] _0_;
  6.   (* src = "examples/alu_hier.py:7" *)
  7.   input [15:0] a;
  8.   (* src = "examples/alu_hier.py:8" *)
  9.   input [15:0] b;
  10.   (* src = "examples/alu_hier.py:9" *)
  11.   output [15:0] o;
  12.   (* src = "examples/alu_hier.py:9" *)
  13.   reg [15:0] \o$next ;
  14.   assign _0_ = a + (* src = "examples/alu_hier.py:13" *) b;
  15.   always @* begin
  16.     \o$next  = 16'h0000;
  17.     \o$next  = _0_[15:0];
  18.   end
  19.   assign o = \o$next ;
  20. endmodule
  21.  
  22. (* generator = "nMigen" *)
  23. module sub(b, o, a);
  24.   wire [16:0] _0_;
  25.   (* src = "examples/alu_hier.py:19" *)
  26.   input [15:0] a;
  27.   (* src = "examples/alu_hier.py:20" *)
  28.   input [15:0] b;
  29.   (* src = "examples/alu_hier.py:21" *)
  30.   output [15:0] o;
  31.   (* src = "examples/alu_hier.py:21" *)
  32.   reg [15:0] \o$next ;
  33.   assign _0_ = a - (* src = "examples/alu_hier.py:25" *) b;
  34.   always @* begin
  35.     \o$next  = 16'h0000;
  36.     \o$next  = _0_[15:0];
  37.   end
  38.   assign o = \o$next ;
  39. endmodule
  40.  
  41. (* top =  1  *)
  42. (* generator = "nMigen" *)
  43. module top(a, b, o, op);
  44.   (* src = "examples/alu_hier.py:32" *)
  45.   input [15:0] a;
  46.   (* src = "examples/alu_hier.py:7" *)
  47.   wire [15:0] add_a;
  48.   (* src = "examples/alu_hier.py:7" *)
  49.   reg [15:0] \add_a$next ;
  50.   (* src = "examples/alu_hier.py:8" *)
  51.   wire [15:0] add_b;
  52.   (* src = "examples/alu_hier.py:8" *)
  53.   reg [15:0] \add_b$next ;
  54.   (* src = "examples/alu_hier.py:9" *)
  55.   wire [15:0] add_o;
  56.   (* src = "examples/alu_hier.py:33" *)
  57.   input [15:0] b;
  58.   (* src = "examples/alu_hier.py:34" *)
  59.   output [15:0] o;
  60.   (* src = "examples/alu_hier.py:34" *)
  61.   reg [15:0] \o$next ;
  62.   (* src = "examples/alu_hier.py:31" *)
  63.   input op;
  64.   (* src = "examples/alu_hier.py:19" *)
  65.   wire [15:0] sub_a;
  66.   (* src = "examples/alu_hier.py:19" *)
  67.   reg [15:0] \sub_a$next ;
  68.   (* src = "examples/alu_hier.py:20" *)
  69.   wire [15:0] sub_b;
  70.   (* src = "examples/alu_hier.py:20" *)
  71.   reg [15:0] \sub_b$next ;
  72.   (* src = "examples/alu_hier.py:21" *)
  73.   wire [15:0] sub_o;
  74.   add add (
  75.     .a(add_a),
  76.     .b(add_b),
  77.     .o(add_o)
  78.   );
  79.   sub sub (
  80.     .a(sub_a),
  81.     .b(sub_b),
  82.     .o(sub_o)
  83.   );
  84.   always @* begin
  85.     \o$next  = 16'h0000;
  86.     \add_a$next  = 16'h0000;
  87.     \add_b$next  = 16'h0000;
  88.     \sub_a$next  = 16'h0000;
  89.     \sub_b$next  = 16'h0000;
  90.     \add_a$next  = a;
  91.     \sub_a$next  = a;
  92.     \add_b$next  = b;
  93.     \sub_b$next  = b;
  94.     casez (op)
  95.       1'h1:
  96.           \o$next  = sub_o;
  97.       1'hz:
  98.           \o$next  = add_o;
  99.     endcase
  100.   end
  101.   assign o = \o$next ;
  102.   assign add_a = \add_a$next ;
  103.   assign add_b = \add_b$next ;
  104.   assign sub_a = \sub_a$next ;
  105.   assign sub_b = \sub_b$next ;
  106. endmodule