42 #include "config_GRLIB_DIR.hpp" 64 const std::list<std::string>& hdl_files,
65 const std::list<std::string>& aux_files)
68 std::string synthesis_file_list;
69 for(
const auto& hdl_file : hdl_files)
71 synthesis_file_list += hdl_file +
";";
80 for(
const auto& aux_file : aux_files)
82 synthesis_file_list += aux_file +
";";
89 if(
Param->isOption(OPT_clock_name))
97 bool connect_iob =
false;
98 if(
Param->isOption(OPT_connect_iob) &&
Param->getOption<
bool>(OPT_connect_iob))
103 if(
Param->isOption(OPT_top_design_name))
111 if(
Param->isOption(OPT_backend_script_extensions))
115 Param->getOption<std::string>(OPT_backend_script_extensions);
121 if(
Param->isOption(OPT_VHDL_library))
146 const auto output_temporary_directory =
Param->getOption<std::string>(OPT_output_temporary_directory);
147 std::ofstream temp_file(output_temporary_directory +
"/temp_xst_prj_file0");
148 temp_file <<
"vhdl grlib GRLIB/grlib/stdlib/version.vhd" << std::endl;
149 temp_file <<
"vhdl grlib GRLIB/grlib/stdlib/stdlib.vhd" << std::endl;
150 temp_file <<
"vhdl grlib GRLIB/grlib/amba/amba.vhd" << std::endl;
151 temp_file <<
"vhdl techmap GRLIB/techmap/gencomp/gencomp.vhd" << std::endl;
152 temp_file <<
"vhdl grlib GRLIB/grlib/amba/devices.vhd" << std::endl;
153 temp_file <<
"vhdl techmap GRLIB/techmap/unisim/pads_unisim.vhd" << std::endl;
154 temp_file <<
"vhdl techmap GRLIB/techmap/maps/allpads.vhd" << std::endl;
155 temp_file <<
"vhdl gaisler GRLIB/gaisler/misc/misc.vhd" << std::endl;
156 temp_file <<
"vhdl techmap GRLIB/techmap/unisim/clkgen_unisim.vhd" << std::endl;
157 temp_file <<
"vhdl techmap GRLIB/techmap/maps/toutpad.vhd" << std::endl;
158 temp_file <<
"vhdl techmap GRLIB/techmap/maps/outpad.vhd" << std::endl;
159 temp_file <<
"vhdl techmap GRLIB/techmap/maps/odpad.vhd" << std::endl;
160 temp_file <<
"vhdl techmap GRLIB/techmap/maps/iopad.vhd" << std::endl;
161 temp_file <<
"vhdl techmap GRLIB/techmap/maps/iodpad.vhd" << std::endl;
162 temp_file <<
"vhdl techmap GRLIB/techmap/maps/inpad.vhd" << std::endl;
163 temp_file <<
"vhdl techmap GRLIB/techmap/maps/allclkgen.vhd" << std::endl;
164 temp_file <<
"vhdl gaisler GRLIB/gaisler/pci/pci.vhd" << std::endl;
165 temp_file <<
"vhdl gaisler GRLIB/gaisler/misc/ahbmst.vhd" << std::endl;
166 temp_file <<
"vhdl techmap GRLIB/techmap/maps/clkpad.vhd" << std::endl;
167 temp_file <<
"vhdl techmap GRLIB/techmap/maps/clkgen.vhd" << std::endl;
168 temp_file <<
"vhdl grlib GRLIB/grlib/amba/apbctrl.vhd" << std::endl;
169 temp_file <<
"vhdl grlib GRLIB/grlib/amba/ahbctrl.vhd" << std::endl;
170 temp_file <<
"vhdl gaisler GRLIB/gaisler/pci/pci_target.vhd" << std::endl;
171 temp_file <<
"vhdl gaisler GRLIB/gaisler/pci/pcipads.vhd" << std::endl;
172 temp_file <<
"vhdl gaisler GRLIB/gaisler/misc/rstgen.vhd" << std::endl;
176 PandaSystem(
Param,
"cat " + output_temporary_directory +
"/temp_xst_prj_file0 " + xst_prj_file,
true,
177 output_temporary_directory +
"/temp_xst_prj_file1");
183 PandaSystem(
Param,
"mv " + output_temporary_directory +
"/temp_xst_prj_file1 " + xst_prj_file);
197 std::ofstream UCF_file(ucf_filename);
198 UCF_file <<
"CONFIG STEPPING=\"0\";" << std::endl;
199 UCF_file <<
"" << std::endl;
200 UCF_file <<
"NET resetn TIG ;" << std::endl;
201 UCF_file <<
"" << std::endl;
202 UCF_file <<
"NET \"clk\" PERIOD = 20.000 ;" << std::endl;
203 UCF_file <<
"" << std::endl;
204 UCF_file <<
"NET \"pci_clk\" PERIOD = 30.000 ;" << std::endl;
205 UCF_file <<
"OFFSET = OUT : 11.000 : AFTER pci_clk ;" << std::endl;
206 UCF_file <<
"OFFSET = IN : 7.000 : BEFORE pci_clk ;" << std::endl;
207 UCF_file <<
"" << std::endl;
208 UCF_file << R
"(NET "clk" LOC = "P20" | IOSTANDARD=LVTTL;)" << std::endl; 209 UCF_file << R"(NET "pci_clk" LOC = "AK19" | IOSTANDARD=LVTTL;)" << std::endl; 210 UCF_file << "" << std::endl;
211 UCF_file << R
"(NET "pllref" LOC = "J19" | IOSTANDARD=LVTTL;)" << std::endl; 212 UCF_file << "" << std::endl;
213 UCF_file << R
"(NET "resetn" LOC = "G38" | IOSTANDARD=LVTTL;)" << std::endl; 214 UCF_file << "" << std::endl;
215 UCF_file << R
"(NET "pci_ad<0>" LOC = "AW16" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 216 UCF_file << R"(NET "pci_ad<1>" LOC = "AV17" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 217 UCF_file << R"(NET "pci_ad<2>" LOC = "AW15" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 218 UCF_file << R"(NET "pci_ad<3>" LOC = "AV15" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 219 UCF_file << R"(NET "pci_ad<4>" LOC = "AU18" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 220 UCF_file << R"(NET "pci_ad<5>" LOC = "AW17" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 221 UCF_file << R"(NET "pci_ad<6>" LOC = "AT18" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 222 UCF_file << R"(NET "pci_ad<7>" LOC = "AP16" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 223 UCF_file << R"(NET "pci_ad<8>" LOC = "AU17" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 224 UCF_file << R"(NET "pci_ad<9>" LOC = "AT16" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 225 UCF_file << R"(NET "pci_ad<10>" LOC = "AU16" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 226 UCF_file << R"(NET "pci_ad<11>" LOC = "AT15" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 227 UCF_file << R"(NET "pci_ad<12>" LOC = "AU15" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 228 UCF_file << R"(NET "pci_ad<13>" LOC = "AR14" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 229 UCF_file << R"(NET "pci_ad<14>" LOC = "AT14" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 230 UCF_file << R"(NET "pci_ad<15>" LOC = "AU13" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 231 UCF_file << R"(NET "pci_ad<16>" LOC = "AT8" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 232 UCF_file << R"(NET "pci_ad<17>" LOC = "AU8" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 233 UCF_file << R"(NET "pci_ad<18>" LOC = "AT9" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 234 UCF_file << R"(NET "pci_ad<19>" LOC = "AU6" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 235 UCF_file << R"(NET "pci_ad<20>" LOC = "AR8" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 236 UCF_file << R"(NET "pci_ad<21>" LOC = "AU7" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 237 UCF_file << R"(NET "pci_ad<22>" LOC = "AU5" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 238 UCF_file << R"(NET "pci_ad<23>" LOC = "AR7" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 239 UCF_file << R"(NET "pci_ad<24>" LOC = "AW7" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 240 UCF_file << R"(NET "pci_ad<25>" LOC = "AV7" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 241 UCF_file << R"(NET "pci_ad<26>" LOC = "AW6" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 242 UCF_file << R"(NET "pci_ad<27>" LOC = "AW5" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 243 UCF_file << R"(NET "pci_ad<28>" LOC = "AV5" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 244 UCF_file << R"(NET "pci_ad<29>" LOC = "AW4" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 245 UCF_file << R"(NET "pci_ad<30>" LOC = "AV4" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 246 UCF_file << R"(NET "pci_ad<31>" LOC = "AV3" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 247 UCF_file << R"(NET "pci_cbe<0>" LOC = "AT13" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 248 UCF_file << R"(NET "pci_cbe<1>" LOC = "AU12" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 249 UCF_file << R"(NET "pci_cbe<2>" LOC = "AR13" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 250 UCF_file << R"(NET "pci_cbe<3>" LOC = "AR12" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 251 UCF_file << "" << std::endl;
252 UCF_file << R
"(NET "pci_66" LOC = "AW14" | IOSTANDARD=LVTTL;)" << std::endl; 253 UCF_file << R"(NET "pci_host" LOC = "AV14" | IOSTANDARD=LVTTL;)" << std::endl; 254 UCF_file << R"(NET "pci_devsel" LOC = "AV10" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this devseln)" 256 UCF_file << R"(NET "pci_frame" LOC = "AR9" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this framen)" 258 UCF_file << R"(NET "pci_gnt" LOC = "AV13" | IOSTANDARD=LVTTL; # the PCI spec calls this gntn)" << std::endl; 259 UCF_file << R"(NET "pci_req" LOC = "AW12" | IOSTANDARD=LVTTL; # the PCI spec calls this reqn)" << std::endl; 260 UCF_file << "" << std::endl;
261 UCF_file << R
"(NET "pci_idsel" LOC = "AV9" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 262 UCF_file << R"(NET "pci_irdy" LOC = "AW9" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this" irdyn)" 264 UCF_file << R"(NET "pci_lock" LOC = "AU11" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this" lockn)" 266 UCF_file << R"(NET "pci_par" LOC = "AW11" | IOSTANDARD=PCI33_3 | BYPASS;)" << std::endl; 267 UCF_file << R"(NET "pci_perr" LOC = "AW10" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this perrn)" 269 UCF_file << R"(NET "pci_rst" LOC = "AV8" | IOSTANDARD=LVTTL; # the PCI spec calls this rstn)" << std::endl; 270 UCF_file << R"(NET "pci_serr" LOC = "AT11" | IOSTANDARD=PCI33_3; # the PCI spec calls this serrn)" << std::endl; 271 UCF_file << R"(NET "pci_stop" LOC = "AV12" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this stopn)" 273 UCF_file << R"(NET "pci_trdy" LOC = "AU10" | IOSTANDARD=PCI33_3 | BYPASS; # the PCI spec calls this trdyn)" #define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
File containing functions and utilities to support the printing of debug messagges.
DesignParametersRef actual_parameters
set of design parameters with the actual values
#define GET_CLASS(obj)
Macro returning the actual type of an object.
std::string flow_name
string-based identifier of the flow
Class specification of the manager of the technology library data structures.
const generic_deviceRef device
information about the target device
int debug_level
debugging level of the class
Wrapper to synthesis tools by Xilinx.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
bool IsError(const int error_value)
Utility include.
#define CLOCK_PORT_NAME
standard name for ports
std::string CreateScripts(const DesignParametersRef dp)
Creates the scripts for the specified tools in the right order, along with the overall configuration...
map_t parameter_values
Map between the name of the parameter and the corresponding string-based value.
std::string GenerateSynthesisScripts(const std::string &fu_name, const structural_managerRef SM, const std::list< std::string > &hdl_files, const std::list< std::string > &aux_files) override
Generates the synthesis scripts for the specified design.
This file contains the definition of the parameters for the synthesis tools.
Wrapper to XST by XILINX.
utility function used to read files.
const ParameterConstRef Param
class containing all the parameters
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
void InitDesignParameters() override
Initializes the parameters.
int PandaSystem(const ParameterConstRef Param, const std::string &system_command, bool host_exec, const std::string &output, const unsigned int type, const bool background, const size_t timeout)
System call forcing execution with bash.
This class describes all classes used to represent a structural object.
std::string GetPath(std::filesystem::path path)
std::string component_name
Name of the component.
XilinxTasteBackendFlow(const ParameterConstRef ¶meters, const std::string &flow_name, const generic_deviceRef _device)
Constructor.
void create_cf(const DesignParametersRef dp, bool xst) override
Creates the UCF file.
Wrapper to implement a synthesis tools by Xilinx targeting Taste architecture.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
std::string GetCurrentPath()
Generic device description.
#define PARAM_xst_prj_file
std::string relocate_compiler_path(const std::string &path, bool resolve_path=false)
refcount< DesignParameters > DesignParametersRef
refcount definition of the class
std::string chain_name
Name of the flow.