Skip to content

Commit

Permalink
Restructured code, modified testbenches
Browse files Browse the repository at this point in the history
  • Loading branch information
samdejong86 committed May 15, 2018
1 parent 6689d7d commit 9f8f335
Show file tree
Hide file tree
Showing 12 changed files with 10,909 additions and 3,121 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ incremental_db/*
*#
output_files/*
greybox_tmp/*
*greybox_tmp/*
greybox_tmp*
*.qws
*.summary
*.rpt
Expand Down
14 changes: 11 additions & 3 deletions ArriaVADCEthernet_top.qsf
Original file line number Diff line number Diff line change
Expand Up @@ -1846,13 +1846,15 @@ set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[31] -
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_clk -to "adc_pll:adc_pll|outclk_0" -section_id nios
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ADVANCED_TRIGGER_ENTITY=basic,1,sld_reserved_ArriaVADCEthernet_nios_2_71f6," -section_id nios
set_global_assignment -name EDA_TEST_BENCH_ENABLE_STATUS TEST_BENCH_MODE -section_id eda_simulation
set_global_assignment -name EDA_NATIVELINK_SIMULATION_TEST_BENCH delayTB -section_id eda_simulation
set_global_assignment -name EDA_NATIVELINK_SIMULATION_TEST_BENCH ADC_testbench -section_id eda_simulation
set_global_assignment -name EDA_TEST_BENCH_NAME delayTB -section_id eda_simulation
set_global_assignment -name EDA_DESIGN_INSTANCE_NAME NA -section_id delayTB
set_global_assignment -name EDA_TEST_BENCH_MODULE_NAME delay_tb -section_id delayTB
set_global_assignment -name EDA_TEST_BENCH_NAME ADC_testbench -section_id eda_simulation
set_global_assignment -name EDA_DESIGN_INSTANCE_NAME NA -section_id ADC_testbench
set_global_assignment -name EDA_TEST_BENCH_MODULE_NAME ADC_testbench -section_id ADC_testbench
set_global_assignment -name SLD_FILE db/ArriaVADCEthernet_top_auto_stripped.stp
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
set_global_assignment -name EDA_TEST_BENCH_FILE testBenches/delayTB.sv -section_id delayTB
set_global_assignment -name SYSTEMVERILOG_FILE ArriaVADCEthernet_top.sv
set_global_assignment -name SDC_FILE ArriaVADCEthernet_top.sdc
set_global_assignment -name CDF_FILE ArriaVADCEthernet_top.cdf
Expand All @@ -1862,9 +1864,15 @@ set_global_assignment -name QIP_FILE adc_mux/ADC_Mux.qip
set_global_assignment -name QIP_FILE ddio_buffer/enet_gtx_clk_ddio_buffer.qip
set_global_assignment -name QIP_FILE adc_pll/adc_pll.qip
set_global_assignment -name SIP_FILE adc_pll/adc_pll.sip
set_global_assignment -name SYSTEMVERILOG_FILE src/ADC_handler.sv
set_global_assignment -name VERILOG_FILE src/trigger.v
set_global_assignment -name VERILOG_FILE src/adcSync.v
set_global_assignment -name SYSTEMVERILOG_FILE src/delayVec.sv
set_global_assignment -name SYSTEMVERILOG_FILE src/waveformGenerator.sv
set_global_assignment -name SYSTEMVERILOG_FILE src/getSample.sv
set_global_assignment -name SYSTEMVERILOG_FILE testBenches/delayTB.sv
set_global_assignment -name SYSTEMVERILOG_FILE testBenches/delayTB.sv
set_global_assignment -name VERILOG_FILE testBenches/triggerTB.v
set_global_assignment -name SYSTEMVERILOG_FILE testBenches/ADC_testbench.sv
set_global_assignment -name EDA_NATIVELINK_SIMULATION_SETUP_SCRIPT testBenches/ADC_test.tcl -section_id eda_simulation
set_global_assignment -name EDA_TEST_BENCH_FILE testBenches/delayTB.sv -section_id delayTB
set_global_assignment -name EDA_TEST_BENCH_FILE testBenches/ADC_testbench.sv -section_id ADC_testbench
132 changes: 16 additions & 116 deletions ArriaVADCEthernet_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -185,40 +185,11 @@ adc_pll adc_pll(
.locked(pll_locked),
.rst(reset_n)
);

reg delay;
reg trigSource;
reg trigSlope;
reg acquire;

wire src1;
wire slp1;
wire del1;


assign delay = adcControl[3];
assign trigSlope = adcControl[2];
assign trigSource = adcControl[1];
wire acquireRequest;
assign acquireRequest = adcControl[0];


wire [15:0] waveNumber;
wire [15:0] lastwavenum;

always @(posedge sys_clk) begin

if(acquireRequest==1&&waveNumber!=lastwavenum) //acquire ('A')
acquire=1;
else
acquire=0;

end


wire [13:0] a2da_data;
wire [13:0] a2db_data;


adcSync sync_a(
.sys_clk(sys_clk),
Expand All @@ -233,92 +204,21 @@ adcSync sync_b(
.ADCin(adc_db),
.ADCout(a2db_data)
);


wire [13:0] DelayVec [100];
wire triggerSelf;
wire triggerExt;
wire trigger;
wire [13:0] waveform [1000];


wire [13:0] delayedSignal;
wire [13:0] triggerLevel;
wire [13:0] trigSourceData;


ADC_Mux delayMux (
.data0x ( DelayVec[0] ),
.data1x ( DelayVec[99] ),
.sel ( delay ),
.result ( delayedSignal )
);

ADC_Mux triggerSlopeMux (
.data0x ( 14'd7000 ),
.data1x ( 14'd9400 ),
.sel ( trigSlope ),
.result ( triggerLevel )
);



assign trigger = (trigSource) ? triggerSelf:triggerExt;



wire running;

assign running = (acquire) ? 1'b0 : sys_clk;

delayVec delayModule(
.clk(sys_clk),
.ADC_IN(a2db_data),
.DelayVec(DelayVec)
);


trigger trigModuleSelf(
.clk(sys_clk),
.ADC_IN(a2db_data),
.trigSlope(trigSlope),
.trigLevel(triggerLevel),
.trigger(triggerSelf)
);

trigger trigModuleExt(
.clk(sys_clk),
.ADC_IN(a2da_data),
.trigSlope(trigSlope),
.trigLevel(triggerLevel),
.trigger(triggerExt)
);


waveformGenerator waveGen(
.clk(running),
.triggerIn(trigger),
.signal(delayedSignal),
.waveform(waveform),
.waveNumber(waveNumber)
);


getSample samplerModule(
.clk(sys_clk),
.sampleNum(SampleNum),
.waveform(waveform),
.wavenum(waveNumber),
.acquire(acquire),
.waveSample(waveSample),
.lastwavenum(lastwavenum)
);








ADC_handler adcHandle(
.adcControl(adcControl),
.a2da_data(a2da_data),
.a2db_data(a2db_data),
.sys_clk(sys_clk),
.SampleNum(SampleNum),
.waveSample(waveSample)

);






endmodule
1 change: 1 addition & 0 deletions adc_mux/ADC_Mux.qip
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set_global_assignment -name IP_GENERATED_DEVICE_FAMILY "{Arria V}"
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) "ADC_Mux.v"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "ADC_Mux_inst.v"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "ADC_Mux_bb.v"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "ADC_Mux_syn.v"]
3 changes: 2 additions & 1 deletion adc_mux/ADC_Mux.v
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ endmodule
// CNX file retrieval info
// ============================================================
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Arria V"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "1"
// Retrieval info: PRIVATE: new_diagram STRING "1"
// Retrieval info: LIBRARY: lpm lpm.lpm_components.all
// Retrieval info: CONSTANT: LPM_SIZE NUMERIC "2"
Expand All @@ -101,4 +101,5 @@ endmodule
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux.bsf FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_inst.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_bb.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_syn.v TRUE
// Retrieval info: LIB_FILE: lpm
3 changes: 2 additions & 1 deletion adc_mux/ADC_Mux_bb.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endmodule
// CNX file retrieval info
// ============================================================
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Arria V"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "1"
// Retrieval info: PRIVATE: new_diagram STRING "1"
// Retrieval info: LIBRARY: lpm lpm.lpm_components.all
// Retrieval info: CONSTANT: LPM_SIZE NUMERIC "2"
Expand All @@ -70,4 +70,5 @@ endmodule
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux.bsf FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_inst.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_bb.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_syn.v TRUE
// Retrieval info: LIB_FILE: lpm
160 changes: 160 additions & 0 deletions adc_mux/ADC_Mux_syn.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
// megafunction wizard: %LPM_MUX%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: LPM_MUX

// ============================================================
// File Name: ADC_Mux.v
// Megafunction Name(s):
// LPM_MUX
//
// Simulation Library Files(s):
// lpm
// ============================================================
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
//
// 16.1.0 Build 196 10/24/2016 SJ Standard Edition
// ************************************************************


//Copyright (C) 2016 Intel Corporation. All rights reserved.
//Your use of Intel Corporation's design tools, logic functions
//and other software and tools, and its AMPP partner logic
//functions, and any output files from any of the foregoing
//(including device programming or simulation files), and any
//associated documentation or information are expressly subject
//to the terms and conditions of the Intel Program License
//Subscription Agreement, the Intel Quartus Prime License Agreement,
//the Intel MegaCore Function License Agreement, or other
//applicable license agreement, including, without limitation,
//that your use is for the sole purpose of programming logic
//devices manufactured by Intel and sold by Intel or its
//authorized distributors. Please refer to the applicable
//agreement for further details.


//lpm_mux DEVICE_FAMILY="Arria V" LPM_SIZE=2 LPM_WIDTH=14 LPM_WIDTHS=1 data result sel
//VERSION_BEGIN 16.1 cbx_lpm_mux 2016:10:19:21:26:20:SJ cbx_mgl 2016:10:19:22:10:30:SJ VERSION_END
// synthesis VERILOG_INPUT_VERSION VERILOG_2001
// altera message_off 10463


//synthesis_resources = lut 5
//synopsys translate_off
`timescale 1 ps / 1 ps
//synopsys translate_on
module ADC_Mux_mux
(
data,
result,
sel) /* synthesis synthesis_clearbox=1 */;
input [27:0] data;
output [13:0] result;
input [0:0] sel;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_off
`endif
tri0 [27:0] data;
tri0 [0:0] sel;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_on
`endif

wire wire_l1_w0_n0_mux_dataout;
wire wire_l1_w10_n0_mux_dataout;
wire wire_l1_w11_n0_mux_dataout;
wire wire_l1_w12_n0_mux_dataout;
wire wire_l1_w13_n0_mux_dataout;
wire wire_l1_w1_n0_mux_dataout;
wire wire_l1_w2_n0_mux_dataout;
wire wire_l1_w3_n0_mux_dataout;
wire wire_l1_w4_n0_mux_dataout;
wire wire_l1_w5_n0_mux_dataout;
wire wire_l1_w6_n0_mux_dataout;
wire wire_l1_w7_n0_mux_dataout;
wire wire_l1_w8_n0_mux_dataout;
wire wire_l1_w9_n0_mux_dataout;
wire [27:0] data_wire;
wire [13:0] result_wire_ext;
wire [0:0] sel_wire;

assign wire_l1_w0_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[14] : data_wire[0];
assign wire_l1_w10_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[24] : data_wire[10];
assign wire_l1_w11_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[25] : data_wire[11];
assign wire_l1_w12_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[26] : data_wire[12];
assign wire_l1_w13_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[27] : data_wire[13];
assign wire_l1_w1_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[15] : data_wire[1];
assign wire_l1_w2_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[16] : data_wire[2];
assign wire_l1_w3_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[17] : data_wire[3];
assign wire_l1_w4_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[18] : data_wire[4];
assign wire_l1_w5_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[19] : data_wire[5];
assign wire_l1_w6_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[20] : data_wire[6];
assign wire_l1_w7_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[21] : data_wire[7];
assign wire_l1_w8_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[22] : data_wire[8];
assign wire_l1_w9_n0_mux_dataout = (sel_wire[0] === 1'b1) ? data_wire[23] : data_wire[9];
assign
data_wire = {data},
result = result_wire_ext,
result_wire_ext = {wire_l1_w13_n0_mux_dataout, wire_l1_w12_n0_mux_dataout, wire_l1_w11_n0_mux_dataout, wire_l1_w10_n0_mux_dataout, wire_l1_w9_n0_mux_dataout, wire_l1_w8_n0_mux_dataout, wire_l1_w7_n0_mux_dataout, wire_l1_w6_n0_mux_dataout, wire_l1_w5_n0_mux_dataout, wire_l1_w4_n0_mux_dataout, wire_l1_w3_n0_mux_dataout, wire_l1_w2_n0_mux_dataout, wire_l1_w1_n0_mux_dataout, wire_l1_w0_n0_mux_dataout},
sel_wire = {sel[0]};
endmodule //ADC_Mux_mux
//VALID FILE


// synopsys translate_off
`timescale 1 ps / 1 ps
// synopsys translate_on
module ADC_Mux (
data0x,
data1x,
sel,
result)/* synthesis synthesis_clearbox = 1 */;

input [13:0] data0x;
input [13:0] data1x;
input sel;
output [13:0] result;

wire [13:0] sub_wire0;
wire [13:0] sub_wire3 = data1x[13:0];
wire [13:0] result = sub_wire0[13:0];
wire [13:0] sub_wire1 = data0x[13:0];
wire [27:0] sub_wire2 = {sub_wire3, sub_wire1};
wire sub_wire4 = sel;
wire sub_wire5 = sub_wire4;

ADC_Mux_mux ADC_Mux_mux_component (
.data (sub_wire2),
.sel (sub_wire5),
.result (sub_wire0));

endmodule

// ============================================================
// CNX file retrieval info
// ============================================================
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Arria V"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "1"
// Retrieval info: PRIVATE: new_diagram STRING "1"
// Retrieval info: LIBRARY: lpm lpm.lpm_components.all
// Retrieval info: CONSTANT: LPM_SIZE NUMERIC "2"
// Retrieval info: CONSTANT: LPM_TYPE STRING "LPM_MUX"
// Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "14"
// Retrieval info: CONSTANT: LPM_WIDTHS NUMERIC "1"
// Retrieval info: USED_PORT: data0x 0 0 14 0 INPUT NODEFVAL "data0x[13..0]"
// Retrieval info: USED_PORT: data1x 0 0 14 0 INPUT NODEFVAL "data1x[13..0]"
// Retrieval info: USED_PORT: result 0 0 14 0 OUTPUT NODEFVAL "result[13..0]"
// Retrieval info: USED_PORT: sel 0 0 0 0 INPUT NODEFVAL "sel"
// Retrieval info: CONNECT: @data 0 0 14 0 data0x 0 0 14 0
// Retrieval info: CONNECT: @data 0 0 14 14 data1x 0 0 14 0
// Retrieval info: CONNECT: @sel 0 0 1 0 sel 0 0 0 0
// Retrieval info: CONNECT: result 0 0 14 0 @result 0 0 14 0
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux.inc FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux.cmp FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux.bsf FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_inst.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_bb.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL ADC_Mux_syn.v TRUE
// Retrieval info: LIB_FILE: lpm
Loading

0 comments on commit 9f8f335

Please sign in to comment.