S
self
Guys
I want to give you an update on the HDL for PCB work I have been
doing. Lately I have collaborated with the Configurable Computing Lab
at Brigham Young University to introduce a new, super simple HDL for
board design capture. A compiler has been written and tested on a few
board designs.
The syntax of the language is highly simplified and efficient compared
to VHDL or even Verilog. The language lets you first define devices,
where functional port names are associated with pin numbers. Then
your instantiate those devices and connect nets to the ports. Device
ports can be single pins or busses.
You can look at the complete code for an example design in these files
https://phdl.svn.sourceforge.net/svnroot/phdl/trunk/projects/FMC_DAC/phdl/devices.phdl
https://phdl.svn.sourceforge.net/svnroot/phdl/trunk/projects/FMC_DAC/phdl/fmc_dac.phdl
For boards with Xilinx FPGAs I have published a utility that
automatically generates the device declaration and instantiation
template to cut down on typing and mistakes.
Please let me know what you think.
I include some example code below for your convenience. Here is a
sample syntax for the device definition. Note that data busses and
repeated signals like GND are handled with a single line declaration.
// Analog Devices high speed DAC
device ad9739 is
attr refPrefix = "U";
attr refDes = "";
attr name = "";
attr value = "";
attr pkg_type = "ANALOG_DEVICES_BC-160-1";
attr mfgr = "Analog Devices";
attr PartNumber = "AD9739BBCZ";
attr cost = "70.00";
pin[13:0] DB1_P =
{L14,L13,L12,L11,L10,L9,L8,L7,L6,L5,L4,L3,L2,L1};
pin[13:0] DB1_N =
{M14,M13,M12,M11,M10,M9,M8,M7,M6,M5,M4,M3,M2,M1};
pin[13:0] DB0_P =
{N14,N13,N12,N11,N10,N9,N8,N7,N6,N5,N4,N3,N2,N1};
pin[13:0] DB0_N =
{P14,P13,P12,P11,P10,P9,P8,P7,P6,P5,P4,P3,P2,P1};
pin[1:8] VDDC = {C1, C2, D1, D2, E1, E2, E3, E4};
pin[1:14] VSSC = {A1, A2, A3, A4, A5, B1, B2, B3, B4, B5, C4, C5,
D4, D5};
pin[1:8] VDDA = {A10, A11, B10, B11, C10, C11, D10, D11};
pin[1:8] VSSA = {A12, A13, B12, B13, C12, C13, D12, D13};
pin[1:18] VSSA_SHIELD = {A6, A9, B6, B9, C6, C9, D6, D9, F1, F2,
F3, F4, E11, E12, E13, E14, F11, F12};
pin NC = {A14};
pin[1:4] IOUTN = {A7, B7, C7, D7};
pin[1:4] IOUTP = {A8, B8, C8, D8};
pin I120 = {B14};
pin VREF = {C14};
pin IPTAT = {D14};
pin DACCLK_N = {C3};
pin DACCLK_P = {D3};
pin IRQ = {F13};
pin RESET = {F14};
pin CS = {G13};
pin SDIO = {G14};
pin SCLK = {H13};
pin SDO = {H14};
pin[1:4] VDD33 = {J3,J4,J11,J12};
pin[1:6] VDD = {G1, G2, G3, G4, G11, G12};
pin[1:10] VSS = {H1, H2, H3, H4, H11, H12, K3, K4, K11, K12};
pin SYNC_OUT_P = {J1};
pin SYNC_OUT_N = {J2};
pin SYNC_IN_P = {K1};
pin SYNC_IN_N = {K2};
pin DCO_P = {J13};
pin DCO_N = {J14};
pin DCI_P = {K13};
pin DCI_N = {K14};
end device;
And here is some sample code of how the parts are wired up.
design fmc_dac is
// device definitions
include "devices.phdl";
// Power and ground nets.
net +3V3, +2V5, +1V8, 1V8_sense, gnd;
// net VDDC, VDDA;
// DAC Signals.
net IOUTP, IOUTN;
net[13:0] DB1_P, DB1_N, DB0_P, DB0_N;
net DACCLK_P, DACCLK_N, DCI_P, DCI_N, DCO_P, DCO_N, SYNC_IN_P,
SYNC_IN_N, SYNC_OUT_P, SYNC_OUT_N;
net IRQ, RESET, SPI_CS, SPI_SCLK, SPI_SDO, SPI_SDI;
net IRQ_2V5, RESET_2V5, SPI_CS_2V5, SPI_SCLK_2V5, SPI_SDO_2V5,
SPI_SDI_2V5;
net DAC_VREF, IPTAT, I120;
net analog_out;
// Clock signals.
net samp_clk_in, bal_clock_p, bal_clock_n, coup_clock_p,
coup_clock_n;
net clock_buf_p, clock_buf_n;
net ADCLK914_Vref;
net out_coup_clock_p, out_coup_clock_n;
// Test signals.
net test_trace_bottom, test_trace_top;
begin
// This the fast DAC itself. Note how concisely the busses are
connected.
inst fast_dac of ad9739 is refDes = "U1";
VDDC = <+1V8>;
VSSC = <gnd>;
VDDA = <+3V3>;
VSSA = <gnd>;
VSSA_SHIELD = <gnd>;
NC = open;
IOUTN = <IOUTN>;
IOUTP = <IOUTP>;
I120 = I120;
VREF = DAC_VREF;
IPTAT = IPTAT;
DACCLK_N = DACCLK_P; // clock polarity reversed for better
routing.
DACCLK_P = DACCLK_N;
IRQ = IRQ;
RESET = RESET;
CS = SPI_CS;
SDIO = SPI_SDI;
SCLK = SPI_SCLK;
SDO = SPI_SDO;
VDD33 = <+3V3>;
VDD = <+1V8>;
VSS = <gnd>;
SYNC_OUT_P = SYNC_OUT_P;
SYNC_OUT_N = SYNC_OUT_N;
SYNC_IN_P = SYNC_IN_P;
SYNC_IN_N = SYNC_IN_N;
DCO_P = DCO_P;
DCO_N = DCO_N;
DCI_P = DCI_P;
DCI_N = DCI_N;
DB1_P = DB1_P;
DB1_N = DB1_N;
DB0_P = DB0_P;
DB0_N = DB0_N;
end inst;
I want to give you an update on the HDL for PCB work I have been
doing. Lately I have collaborated with the Configurable Computing Lab
at Brigham Young University to introduce a new, super simple HDL for
board design capture. A compiler has been written and tested on a few
board designs.
The syntax of the language is highly simplified and efficient compared
to VHDL or even Verilog. The language lets you first define devices,
where functional port names are associated with pin numbers. Then
your instantiate those devices and connect nets to the ports. Device
ports can be single pins or busses.
You can look at the complete code for an example design in these files
https://phdl.svn.sourceforge.net/svnroot/phdl/trunk/projects/FMC_DAC/phdl/devices.phdl
https://phdl.svn.sourceforge.net/svnroot/phdl/trunk/projects/FMC_DAC/phdl/fmc_dac.phdl
For boards with Xilinx FPGAs I have published a utility that
automatically generates the device declaration and instantiation
template to cut down on typing and mistakes.
Please let me know what you think.
I include some example code below for your convenience. Here is a
sample syntax for the device definition. Note that data busses and
repeated signals like GND are handled with a single line declaration.
// Analog Devices high speed DAC
device ad9739 is
attr refPrefix = "U";
attr refDes = "";
attr name = "";
attr value = "";
attr pkg_type = "ANALOG_DEVICES_BC-160-1";
attr mfgr = "Analog Devices";
attr PartNumber = "AD9739BBCZ";
attr cost = "70.00";
pin[13:0] DB1_P =
{L14,L13,L12,L11,L10,L9,L8,L7,L6,L5,L4,L3,L2,L1};
pin[13:0] DB1_N =
{M14,M13,M12,M11,M10,M9,M8,M7,M6,M5,M4,M3,M2,M1};
pin[13:0] DB0_P =
{N14,N13,N12,N11,N10,N9,N8,N7,N6,N5,N4,N3,N2,N1};
pin[13:0] DB0_N =
{P14,P13,P12,P11,P10,P9,P8,P7,P6,P5,P4,P3,P2,P1};
pin[1:8] VDDC = {C1, C2, D1, D2, E1, E2, E3, E4};
pin[1:14] VSSC = {A1, A2, A3, A4, A5, B1, B2, B3, B4, B5, C4, C5,
D4, D5};
pin[1:8] VDDA = {A10, A11, B10, B11, C10, C11, D10, D11};
pin[1:8] VSSA = {A12, A13, B12, B13, C12, C13, D12, D13};
pin[1:18] VSSA_SHIELD = {A6, A9, B6, B9, C6, C9, D6, D9, F1, F2,
F3, F4, E11, E12, E13, E14, F11, F12};
pin NC = {A14};
pin[1:4] IOUTN = {A7, B7, C7, D7};
pin[1:4] IOUTP = {A8, B8, C8, D8};
pin I120 = {B14};
pin VREF = {C14};
pin IPTAT = {D14};
pin DACCLK_N = {C3};
pin DACCLK_P = {D3};
pin IRQ = {F13};
pin RESET = {F14};
pin CS = {G13};
pin SDIO = {G14};
pin SCLK = {H13};
pin SDO = {H14};
pin[1:4] VDD33 = {J3,J4,J11,J12};
pin[1:6] VDD = {G1, G2, G3, G4, G11, G12};
pin[1:10] VSS = {H1, H2, H3, H4, H11, H12, K3, K4, K11, K12};
pin SYNC_OUT_P = {J1};
pin SYNC_OUT_N = {J2};
pin SYNC_IN_P = {K1};
pin SYNC_IN_N = {K2};
pin DCO_P = {J13};
pin DCO_N = {J14};
pin DCI_P = {K13};
pin DCI_N = {K14};
end device;
And here is some sample code of how the parts are wired up.
design fmc_dac is
// device definitions
include "devices.phdl";
// Power and ground nets.
net +3V3, +2V5, +1V8, 1V8_sense, gnd;
// net VDDC, VDDA;
// DAC Signals.
net IOUTP, IOUTN;
net[13:0] DB1_P, DB1_N, DB0_P, DB0_N;
net DACCLK_P, DACCLK_N, DCI_P, DCI_N, DCO_P, DCO_N, SYNC_IN_P,
SYNC_IN_N, SYNC_OUT_P, SYNC_OUT_N;
net IRQ, RESET, SPI_CS, SPI_SCLK, SPI_SDO, SPI_SDI;
net IRQ_2V5, RESET_2V5, SPI_CS_2V5, SPI_SCLK_2V5, SPI_SDO_2V5,
SPI_SDI_2V5;
net DAC_VREF, IPTAT, I120;
net analog_out;
// Clock signals.
net samp_clk_in, bal_clock_p, bal_clock_n, coup_clock_p,
coup_clock_n;
net clock_buf_p, clock_buf_n;
net ADCLK914_Vref;
net out_coup_clock_p, out_coup_clock_n;
// Test signals.
net test_trace_bottom, test_trace_top;
begin
// This the fast DAC itself. Note how concisely the busses are
connected.
inst fast_dac of ad9739 is refDes = "U1";
VDDC = <+1V8>;
VSSC = <gnd>;
VDDA = <+3V3>;
VSSA = <gnd>;
VSSA_SHIELD = <gnd>;
NC = open;
IOUTN = <IOUTN>;
IOUTP = <IOUTP>;
I120 = I120;
VREF = DAC_VREF;
IPTAT = IPTAT;
DACCLK_N = DACCLK_P; // clock polarity reversed for better
routing.
DACCLK_P = DACCLK_N;
IRQ = IRQ;
RESET = RESET;
CS = SPI_CS;
SDIO = SPI_SDI;
SCLK = SPI_SCLK;
SDO = SPI_SDO;
VDD33 = <+3V3>;
VDD = <+1V8>;
VSS = <gnd>;
SYNC_OUT_P = SYNC_OUT_P;
SYNC_OUT_N = SYNC_OUT_N;
SYNC_IN_P = SYNC_IN_P;
SYNC_IN_N = SYNC_IN_N;
DCO_P = DCO_P;
DCO_N = DCO_N;
DCI_P = DCI_P;
DCI_N = DCI_N;
DB1_P = DB1_P;
DB1_N = DB1_N;
DB0_P = DB0_P;
DB0_N = DB0_N;
end inst;