diff --git a/resources/script/xilinx/program.tcl b/resources/script/xilinx/program.tcl new file mode 100644 index 0000000..b2174e7 --- /dev/null +++ b/resources/script/xilinx/program.tcl @@ -0,0 +1,27 @@ + +open_hw -quiet +connect_hw_server -quiet +set found 0 +foreach hw_target [get_hw_targets] { + current_hw_target $hw_target + open_hw_target -quiet + foreach hw_device [get_hw_devices] { + if { [string equal -length 6 [get_property PART $hw_device] xc7z020clg400-2] == 1 } { + puts "------Successfully Found Hardware Target with a xc7z020clg400-2 device------ " + current_hw_device $hw_device + set found 1 + } + } + if {$found == 1} {break} + close_hw_target +} + +#download the hw_targets +if {$found == 0 } { + puts "******ERROR : Did not find any Hardware Target with a xc7z020clg400-2 device****** " +} else { + set_property PROGRAM.FILE ./[current_project].bit [current_hw_device] + program_hw_devices [current_hw_device] -quiet + disconnect_hw_server -quiet +} +file delete /home/dide/project/Digital-IDE/resources/script/xilinx/program.tcl -force diff --git a/src/hdlParser/core.ts b/src/hdlParser/core.ts index b127d0f..b2037e5 100644 --- a/src/hdlParser/core.ts +++ b/src/hdlParser/core.ts @@ -486,13 +486,13 @@ class HdlParam { } for (const rawHdlModule of fast.content) { - const moduleName = rawHdlModule.name; - if (uncheckedModuleNames.has(moduleName)) { + const renderName = moduleFile.makeKey(rawHdlModule.name, rawHdlModule.archName); + if (uncheckedModuleNames.has(renderName)) { // match the same module, check then - const originalModule = moduleFile.getHdlModule(moduleName); - uncheckedModuleNames.delete(moduleName); - originalModule?.update(rawHdlModule); - } else { + const originalModule = moduleFile.getHdlModule(renderName); + uncheckedModuleNames.delete(renderName); + originalModule?.update(rawHdlModule); + } else { // no matched, create it const newModule = moduleFile.createHdlModule(rawHdlModule); newModule.makeNameToInstances(); @@ -1153,7 +1153,6 @@ export class HdlFile { // make nameToModule this.nameToModule = new Map(); - for (const rawHdlModule of modules) { this.createHdlModule(rawHdlModule); } @@ -1174,6 +1173,7 @@ export class HdlFile { } public makeKey(name: string, archName: string | undefined): string { + archName = archName ? archName: undefined; return archName === undefined ? name: `${name}(${archName})`; } @@ -1235,6 +1235,7 @@ export class HdlFile { public deleteHdlModule(name: string) { let hdlModule = this.getHdlModule(name); + if (hdlModule) { // delete child reference in the module which use this for (const childInst of hdlModule.getAllGlobalRefers()) {