| `timescale 1ns / 1ns |
| `define AUTOMATIC_self |
| `define AUTOMATIC_decode |
| `define AUTOMATIC_piezo_couple |
| `define AUTOMATIC_compr |
| `define AUTOMATIC_amp_lp |
| `define AUTOMATIC_cav_elec |
| `define AUTOMATIC_prng |
| `define AUTOMATIC_a_cav |
| `define AUTOMATIC_a_for |
| `define AUTOMATIC_a_rfl |
| `include "station_auto.vh" |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| module station( |
| input clk, |
| input iq, |
| input signed [17:0] drive, |
| input start, |
| input signed [17:0] mech_x, |
| input signed [17:0] piezo, |
| input start_outer, |
| |
| output signed [15:0] a_field, |
| output signed [15:0] a_forward, |
| output signed [15:0] a_reflect, |
| output signed [17:0] cav_eig_drive, |
| output signed [17:0] piezo_eig_drive, |
| input [11:0] beam_timing, |
| |
| `AUTOMATIC_self |
| ); |
| `undef AUTOMATIC_self |
|
|
| `AUTOMATIC_decode |
|
|
| |
| |
| (* lb_automatic *) |
| outer_prod piezo_couple |
| (.clk(clk), .start(start_outer), .x(piezo), .result(piezo_eig_drive), |
| `AUTOMATIC_piezo_couple |
| ); |
|
|
| |
| wire signed [17:0] compress_out; |
| (* lb_automatic *) |
| a_compress compr |
| (.clk(clk), .iq(iq), .d_in(drive), .d_out(compress_out), |
| `AUTOMATIC_compr); |
| reg signed [17:0] compress_out_d=0; |
| always @(posedge clk) compress_out_d <= compress_out; |
| wire signed [17:0] ampf_in = compress_out_d; |
|
|
| |
| wire signed [17:0] amp_out1; |
| (* lb_automatic *) |
| lp_pair #(.shift(2)) amp_lp |
| (.clk(clk), .drive(ampf_in), .drive2(24'b0), .res(amp_out1), `AUTOMATIC_amp_lp); |
|
|
| |
| |
| |
| parameter n_mech_modes = 7; |
| parameter n_cycles = n_mech_modes * 2; |
| parameter interp_span = 4; |
| parameter mode_count = 3; |
|
|
| |
| parameter mode_shift=18; |
|
|
| |
| parameter df_scale=0; |
|
|
| |
| wire signed [17:0] field, forward, reflect; |
| (* lb_automatic *) |
| cav_elec #(.mode_shift(mode_shift), .interp_span(interp_span), .df_scale(df_scale), .mode_count(mode_count)) cav_elec |
| (.clk(clk), |
| .iq(iq), .drive(amp_out1), .beam_timing(beam_timing), |
| .field(field), .forward(forward), .reflect(reflect), |
| .start(start), .mech_x(mech_x), .eig_drive(cav_eig_drive), |
| `AUTOMATIC_cav_elec |
| ); |
|
|
| |
| wire [31:0] rnda, rndb; |
| (* lb_automatic *) |
| prng prng |
| (.clk(clk), .rnda(rnda), .rndb(rndb), |
| `AUTOMATIC_prng); |
|
|
| |
| |
| (* lb_automatic *) |
| adc_em #(.del(1)) a_cav |
| (.clk(clk), .strobe(iq), .in(field), .rnd(rnda[12: 0]), .adc(a_field), `AUTOMATIC_a_cav); |
| (* lb_automatic *) |
| adc_em #(.del(1)) a_for |
| (.clk(clk), .strobe(iq), .in(forward), .rnd(rnda[25:13]), .adc(a_forward), `AUTOMATIC_a_for); |
| (* lb_automatic *) |
| adc_em #(.del(1)) a_rfl |
| (.clk(clk), .strobe(iq), .in(reflect), .rnd(rndb[12: 0]), .adc(a_reflect), `AUTOMATIC_a_rfl); |
|
|
| `undef AUTOMATIC_prng |
| endmodule |
|
|