manili
11/11/2021, 1:45 PMmanili
11/11/2021, 1:47 PMmodule user_project_wrapper #(
parameter BITS = 32
) (
`ifdef USE_POWER_PINS
inout vdda1, // User area 1 3.3V supply
inout vdda2, // User area 2 3.3V supply
inout vssa1, // User area 1 analog ground
inout vssa2, // User area 2 analog ground
inout vccd1, // User area 1 1.8V supply
inout vccd2, // User area 2 1.8v supply
inout vssd1, // User area 1 digital ground
inout vssd2, // User area 2 digital ground
`endif
// Wishbone Slave ports (WB MI A)
input wb_clk_i,
input wb_rst_i,
input wbs_stb_i,
input wbs_cyc_i,
input wbs_we_i,
input [3:0] wbs_sel_i,
input [31:0] wbs_dat_i,
input [31:0] wbs_adr_i,
output wbs_ack_o,
output [31:0] wbs_dat_o,
// Logic Analyzer Signals
input [127:0] la_data_in,
output [127:0] la_data_out,
input [127:0] la_oenb,
// IOs
input [`MPRJ_IO_PADS-1:0] io_in,
output [`MPRJ_IO_PADS-1:0] io_out,
output [`MPRJ_IO_PADS-1:0] io_oeb,
// Analog (direct connection to GPIO pad---use with caution)
// Note that analog I/O is not available on the 7 lowest-numbered
// GPIO pads, and so the analog_io indexing is offset from the
// GPIO indexing by 7 (also upper 2 GPIOs do not have analog_io).
inout [`MPRJ_IO_PADS-10:0] analog_io,
// Independent clock (on independent integer divider)
input user_clock2,
// User maskable interrupt signals
output [2:0] user_irq
);
/*--------------------------------------*/
/* User project is instantiated here */
/*--------------------------------------*/
wire [9:0] CORE_to_DAC_DATA;
wire PLL_to_CORE_CLK;
avsddac dac (
`ifdef USE_POWER_PINS
.vccd1(vccd1), // User area 1 1.8V power
.vssd1(vssd1), // User area 1 digital ground
`endif
.OUT(analog_io[7]),
.D(CORE_to_DAC_DATA),
.VREFH(analog_io[8]),
.VREFL(analog_io[9])
);
avsdpll pll (
`ifdef USE_POWER_PINS
.vccd1(vccd1), // User area 1 1.8V power
.vssd1(vssd1), // User area 1 digital ground
`endif
.CLK(PLL_to_CORE_CLK),
.VCO_IN(analog_io[10]),
.ENb_CP(wbs_sel_i[1]),
.ENb_VCO(wbs_sel_i[0]),
.REF(wb_clk_i)
);
user_proj_example mprj (
`ifdef USE_POWER_PINS
.vccd1(vccd1), // User area 1 1.8V power
.vssd1(vssd1), // User area 1 digital ground
`endif
.OUT(CORE_to_DAC_DATA),
.CLK(PLL_to_CORE_CLK),
.reset(wb_rst_i),
);
endmodule // user_project_wrapper
`default_nettype wire
manili
11/11/2021, 3:53 PMTim Edwards
11/11/2021, 4:05 PMreg_mprj_io_15 = GPIO_MODE_USER_STD_ANALOG
to enable analog configuration, followed by toggling the transfer bit as is done in all of the testbenches in verilog/dv/caravel/mgmt_soc/
. For analog simulation, you can assume that there is a 150-ohm resistor between analog_io
and the pad.manili
11/11/2021, 4:19 PMmanili
11/11/2021, 4:20 PMTim Edwards
11/11/2021, 4:23 PManalog_io[7]
uses the same GPIO pin as io_in[14]
, and so forth.Tim Edwards
11/11/2021, 4:24 PM