#
# Copyright 2012 Jared Boone
#
# This file is part of HackRF.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

NET "CODEC_CLK"    LOC="23" |IOSTANDARD=LVCMOS33;
NET "CODEC_X2_CLK" LOC="27" |IOSTANDARD=LVCMOS33;
#NET "GCLK0" LOC="22" |IOSTANDARD=LVCMOS33;

NET "CODEC_X2_CLK" TNM_NET = CODEC_X2_CLK;
TIMESPEC TS_codec_x2_data = PERIOD "CODEC_X2_CLK" 50 ns;

NET "DA<7>" LOC="35" |IOSTANDARD=LVCMOS33;
NET "DA<6>" LOC="36" |IOSTANDARD=LVCMOS33;
NET "DA<5>" LOC="37" |IOSTANDARD=LVCMOS33;
NET "DA<4>" LOC="39" |IOSTANDARD=LVCMOS33;
NET "DA<3>" LOC="40" |IOSTANDARD=LVCMOS33;
NET "DA<2>" LOC="41" |IOSTANDARD=LVCMOS33;
NET "DA<1>" LOC="42" |IOSTANDARD=LVCMOS33;
NET "DA<0>" LOC="43" |IOSTANDARD=LVCMOS33;

NET "DD<9>" LOC="17" |IOSTANDARD=LVCMOS33;
NET "DD<8>" LOC="18" |IOSTANDARD=LVCMOS33;
NET "DD<7>" LOC="19" |IOSTANDARD=LVCMOS33;
NET "DD<6>" LOC="24" |IOSTANDARD=LVCMOS33;
NET "DD<5>" LOC="28" |IOSTANDARD=LVCMOS33;
NET "DD<4>" LOC="29" |IOSTANDARD=LVCMOS33;
NET "DD<3>" LOC="30" |IOSTANDARD=LVCMOS33;
NET "DD<2>" LOC="32" |IOSTANDARD=LVCMOS33;
NET "DD<1>" LOC="33" |IOSTANDARD=LVCMOS33;
NET "DD<0>" LOC="34" |IOSTANDARD=LVCMOS33;

NET "B1AUX<16>" LOC="60" |IOSTANDARD=LVCMOS33;
NET "B1AUX<15>" LOC="58" |IOSTANDARD=LVCMOS33;
NET "B1AUX<14>" LOC="56" |IOSTANDARD=LVCMOS33;
NET "B1AUX<13>" LOC="55" |IOSTANDARD=LVCMOS33;
NET "B1AUX<12>" LOC="53" |IOSTANDARD=LVCMOS33;
NET "B1AUX<11>" LOC="52" |IOSTANDARD=LVCMOS33;
NET "B1AUX<10>" LOC="50" |IOSTANDARD=LVCMOS33;
NET "B1AUX<9>"  LOC="49" |IOSTANDARD=LVCMOS33;

#NET "SGPIO<15>" LOC="78" |IOSTANDARD=LVCMOS33;
#NET "SGPIO<14>" LOC="81" |IOSTANDARD=LVCMOS33;
#NET "SGPIO<13>" LOC="90" |IOSTANDARD=LVCMOS33;
#NET "SGPIO<12>" LOC="70" |IOSTANDARD=LVCMOS33;
NET "HOST_DIRECTION" LOC="71" |IOSTANDARD=LVCMOS33;
NET "HOST_DISABLE"   LOC="76" |IOSTANDARD=LVCMOS33;
NET "HOST_CAPTURE"   LOC="91" |IOSTANDARD=LVCMOS33;
#NET "HOST_CLK"       LOC="68" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<7>"   LOC="77" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<6>"   LOC="61" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<5>"   LOC="64" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<4>"   LOC="67" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<3>"   LOC="72" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<2>"   LOC="74" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<1>"   LOC="79" |IOSTANDARD=LVCMOS33;
NET "HOST_DATA<0>"   LOC="89" |IOSTANDARD=LVCMOS33;

NET "B2AUX<16>" LOC="92" |IOSTANDARD=LVCMOS33;
NET "B2AUX<15>" LOC="94" |IOSTANDARD=LVCMOS33;
NET "B2AUX<14>" LOC="97" |IOSTANDARD=LVCMOS33;
NET "B2AUX<13>" LOC="99" |IOSTANDARD=LVCMOS33;
NET "B2AUX<12>" LOC="1"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<11>" LOC="2"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<10>" LOC="3"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<9>"  LOC="4"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<8>"  LOC="6"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<7>"  LOC="7"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<6>"  LOC="8"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<5>"  LOC="9"  |IOSTANDARD=LVCMOS33;
NET "B2AUX<4>"  LOC="10" |IOSTANDARD=LVCMOS33;
NET "B2AUX<3>"  LOC="11" |IOSTANDARD=LVCMOS33;
NET "B2AUX<2>"  LOC="12" |IOSTANDARD=LVCMOS33;
NET "B2AUX<1>"  LOC="13" |IOSTANDARD=LVCMOS33;

INST "DA<0>" TNM=adc_data;
INST "DA<1>" TNM=adc_data;
INST "DA<2>" TNM=adc_data;
INST "DA<3>" TNM=adc_data;
INST "DA<4>" TNM=adc_data;
INST "DA<5>" TNM=adc_data;
INST "DA<6>" TNM=adc_data;
INST "DA<7>" TNM=adc_data;

TIMESPEC "TS_adc_data" = FROM "adc_data" TO "CODEC_X2_CLK" 16 ns;

INST "DD<0>" TNM=dac_data;
INST "DD<1>" TNM=dac_data;
INST "DD<2>" TNM=dac_data;
INST "DD<3>" TNM=dac_data;
INST "DD<4>" TNM=dac_data;
INST "DD<5>" TNM=dac_data;
INST "DD<6>" TNM=dac_data;
INST "DD<7>" TNM=dac_data;
INST "DD<8>" TNM=dac_data;
INST "DD<9>" TNM=dac_data;

TIMESPEC "TS_dac_data" = FROM "CODEC_X2_CLK" TO "dac_data" 15 ns;

INST "HOST_DATA<7>" TNM=to_host;
INST "HOST_DATA<6>" TNM=to_host;
INST "HOST_DATA<5>" TNM=to_host;
INST "HOST_DATA<4>" TNM=to_host;
INST "HOST_DATA<3>" TNM=to_host;
INST "HOST_DATA<2>" TNM=to_host;
INST "HOST_DATA<1>" TNM=to_host;
INST "HOST_DATA<0>" TNM=to_host;
INST "HOST_CAPTURE" TNM=to_host;

#TIMESPEC "TS_to_host" = FROM "to_host" TO "HOST_CLK" 6 ns;
#TIMEGRP "to_host" OFFSET=OUT 6 ns AFTER "HOST_CLK";
