Changeset 20
- Timestamp:
- 05/12/08 04:22:16 (2 years ago)
- Location:
- XilinxTools
- Files:
-
- 4 added
- 1 modified
-
xilinx_compile.py (modified) (7 diffs)
-
xst.py (added)
-
xst_io.py (added)
-
xst_logparse.py (added)
-
XST_virtex5_run.xlsx (added)
Legend:
- Unmodified
- Added
- Removed
-
XilinxTools/xilinx_compile.py
r18 r20 1 run, runXST, runNGDBuild, runMAP, runPAR, runBitgen = True, False, False, False, False, True2 1 run, runXST, runNGDBuild, runMAP, runPAR, runBitgen = True, True, True, True, True, True 2 getXDL = True 3 3 import os 4 4 import subprocess … … 15 15 XilinxBin = os.path.join(XilinxPath,'bin\\nt') 16 16 17 18 tmp_dir = "tmp" 19 hdp_dir = "xst" 20 17 21 syn_param = """ 18 22 # … … 84 88 85 89 """% locals() 86 87 tmp_dir = "tmp"88 hdp_dir = "xst"89 90 90 #Generate XST file 91 91 xst_file = open("%s.xst"%topmodule, mode='w') … … 156 156 157 157 158 158 class XSTFile: 159 def __init__(self,name): 160 if os.path.exists(name): 161 self.File = open(name) 162 163 164 class Synthesizer: 165 def __init__(self): 166 self.xst_path = os.path.join(XilinxBin,"xst") 167 self.XST_Attr_Map = {} 168 169 self.InputFileName 170 self.XST_Attr 171 self.InputFormat 172 173 174 def Run(self): 175 RunReq = [self.xst_path,"-ifn", "%s.xst"%topmodule, "-ofn", "%s_xst_log.syr"%topmodule] 176 print "Invoking Synthesis Tool: " + RunReq 177 self.retcode = subprocess.call(RunReq) 178 179 def LogPrint(Port,File): 180 ln = Port.readline() 181 print ln 182 File.write(ln) 183 184 #todo: define classes for each of the synthesis and placement files 185 #create XML-RPC interface to marshal and demarshal components and invoke toolchain 159 186 if __name__ == "__main__": 160 187 if run: … … 163 190 xst_path = os.path.join(XilinxBin,"xst") 164 191 retcode = subprocess.call([xst_path,"-ifn", "%s.xst"%topmodule, "-ofn", "%s_xst_log.syr"%topmodule]) 165 166 192 if runNGDBuild: 167 193 #Invoke NGDBuild … … 174 200 map_path = os.path.join(XilinxBin,"map") 175 201 retcode = subprocess.call([map_path, '-p', part, '-cm', 'area', '-pr', 'b', '-k', '4', '-c', '100', '-tx', 'off', '-o', '%s_map.ncd'%topmodule, '%s.ngd'%topmodule, '%s.pcf'%topmodule]) 176 202 if genXDL: 203 xdl_path = os.path.join(XilinxBin,"xdl") 204 retcode = subprocess.call([xdl_path,'-ncd2xdl','%s_map.ncd'%topmodule]) 177 205 if runPAR: 178 206 #Invoke PAR 179 207 par_path = os.path.join(XilinxBin,"par") 180 208 retcode = subprocess.call([par_path, '-w', '-ol', 'std', '-t', '1', '%s_map.ncd'%topmodule, '%s_par.ncd'%topmodule, '%s.pcf'%topmodule]) 181 209 if genXDL: 210 xdl_path = os.path.join(XilinxBin,"xdl") 211 retcode = subprocess.call([xdl_path,'-ncd2xdl','%s_par.ncd'%topmodule]) 182 212 if runBitgen: 183 213 #Invoke Bitgen … … 186 216 for opt in bit_gen_g_options: 187 217 bitgen_arglist.append('-g') 188 bitgen_arglist.append( opt)218 bitgen_arglist.append('%s'%opt) 189 219 retcode = subprocess.call(bitgen_arglist)
