当前位置:首页 > Software > Python > 正文内容

(原创)使用Python提取ISE工程的RTL代码

chanra1n2年前 (2023-05-21)Python4385

在工程文件夹下运行Python程序即可

#Author       : /
#Description  : 从ISE的项目文件夹中提取rtl文件,用于LEDA调试
#Time         : 20220811
#Verision     : 0.1
#CopyRights   : myfpga.cn All Right Reservers. 

import os
import shutil
for temp_file in os.listdir():
    if temp_file.endswith(".prj") :
        prj_name_temp = os.path.splitext(temp_file)
        prj_name = prj_name_temp[0]
        os.mkdir(prj_name+'_rtl')
        print('********************************'+prj_name+'********************************')
        f = open(temp_file,'r')
        for line in f.readlines():
            line = line.split('"')
            try:
                shutil.copyfile(line[1],prj_name+'_rtl/'+os.path.basename(line[1]))
            except:
                print('Error:line[1]')
        f.close()


扫描二维码推送至手机访问。

版权声明:本文由我的FPGA发布,如需转载请注明出处。

本文链接:https://world.myfpga.cn/index.php/post/308.html

分享给朋友:

“(原创)使用Python提取ISE工程的RTL代码” 的相关文章

0.Python环境的搭建

0.Python环境的搭建

   请打开网页  https://www.python.org/downloads/windows/    Windows环境下的Python        这里我选择...

math库的使用

math库的使用

math库包括4个数学常数math.pi      圆周率math.e       自然对数math.inf     正无穷大,负无穷大为-math.infmath.nan     非浮点数标记math库常用函数math.cell(x)      向上取整,返回不小于x的最小整数math.facto...

搜索字符串

搜索字符串

常用搜索字符串中子串的方法str.count(substring)      返回str中substring子串出现的无覆盖的次数str.find(s1)                    返回s1在这个字符串的最低下标,如果字符串中不存在s1,则返回-1str.rfind(s1)       ...

random库

random库

random()            生成一个[0.0,1.0)之间的随机小数randint(a,b)     生成一个[a,b]之间的整数uniform(a,b)     生成一个[a,b]之间的随机小数对random库的引用方法与math库一样,采用下面两种方式实现:import random...

列表作为函数参数

列表作为函数参数

列表作为函数参数,函数中可以修改原列表def multiply(values,factor):     for i in range(len(values)):        values[i]*=factor          aList=[1,2,3,4,5]  multiply(aL...

一文快速搞定基本Python

一文快速搞定基本Python

本文适宜有熟练其他高级语言编程基础的同行参阅,或复习用,转载请保留作者信息 Myfpga.cn Chanra1n输入输出#input输入命令,中间的即提示语,左面的a为输入的值存到哪里 a=input("请输入a的值:") #print()可以直接print("He...