This commit is contained in:
锦恢 2024-09-26 20:09:54 +08:00
parent dd37321295
commit e22fdd8f4b
12 changed files with 705 additions and 98 deletions

635
efinity.json Normal file
View File

@ -0,0 +1,635 @@
{
"efx:project": {
"_attributes": {
"xmlns:efx": "http://www.efinixinc.com/enf_proj",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"name": "Ti60_Demo",
"description": "",
"last_change": "1724637727",
"sw_version": "2023.2.307",
"last_run_state": "pass",
"last_run_flow": "bitstream",
"config_result_in_sync": "sync",
"design_ood": "sync",
"place_ood": "sync",
"route_ood": "sync",
"xsi:schemaLocation": "http://www.efinixinc.com/enf_proj enf_proj.xsd"
},
"efx:device_info": {
"efx:family": {
"_attributes": {
"name": "Titanium"
}
},
"efx:device": {
"_attributes": {
"name": "Ti60F100S3F2"
}
},
"efx:timing_model": {
"_attributes": {
"name": "C4"
}
}
},
"efx:design_info": {
"_attributes": {
"def_veri_version": "verilog_2k",
"def_vhdl_version": "vhdl_2008"
},
"efx:top_module": {
"_attributes": {
"name": "example_top"
}
},
"efx:design_file": [
{
"_attributes": {
"name": "example_top.v",
"version": "default",
"library": "default"
}
},
{
"_attributes": {
"name": "src/Reset.v",
"version": "default",
"library": "default"
}
},
{
"_attributes": {
"name": "src/uart_index/precise_divider.v",
"version": "default",
"library": "default"
}
},
{
"_attributes": {
"name": "src/uart_index/uart_transfer.v",
"version": "default",
"library": "default"
}
},
{
"_attributes": {
"name": "src/uart_index/uart_receiver.v",
"version": "default",
"library": "default"
}
},
{
"_attributes": {
"name": "src/uart_index/integer_divider.v",
"version": "default",
"library": "default"
}
}
],
"efx:top_vhdl_arch": {
"_attributes": {
"name": ""
}
}
},
"efx:constraint_info": {
"efx:sdc_file": {
"_attributes": {
"name": "Ti60_Demo.pt.sdc"
}
},
"efx:inter_file": {
"_attributes": {
"name": ""
}
}
},
"efx:sim_info": {},
"efx:misc_info": {},
"efx:ip_info": {
"efx:ip": {
"_attributes": {
"instance_name": "FIFO_4Kx8",
"path": "ip/FIFO_4Kx8/settings.json"
},
"efx:ip_src_file": {
"_attributes": {
"name": "FIFO_4Kx8.v"
}
}
}
},
"efx:synthesis": {
"_attributes": {
"tool_name": "efx_map"
},
"efx:param": [
{
"_attributes": {
"name": "work_dir",
"value": "prj/work_syn",
"value_type": "e_string"
}
},
{
"_attributes": {
"name": "write_efx_verilog",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "mode",
"value": "speed",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "max_ram",
"value": "-1",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "max_mult",
"value": "-1",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "infer-clk-enable",
"value": "3",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "infer-sync-set-reset",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "fanout-limit",
"value": "0",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "seq_opt",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "retiming",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "dsp-mac-packing",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "dsp-input-regs-packing",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "dsp-output-regs-packing",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "bram_output_regs_packing",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "blast_const_operand_adders",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "operator-sharing",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "optimize-adder-tree",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "pack-luts-to-comb4",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "min-sr-fanout",
"value": "0",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "min-ce-fanout",
"value": "0",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "seq-opt-sync-only",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "blackbox-error",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "allow-const-ram-index",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "hdl-compile-unit",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "create-onehot-fsms",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "mult-decomp-retime",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "optimize-zero-init-rom",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "insert-carry-skip",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "mult-auto-pipeline",
"value": "0",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "use-logic-for-small-mem",
"value": "64",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "use-logic-for-small-rom",
"value": "64",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "include",
"value": "ip/FIFO_4Kx8",
"value_type": "e_string"
}
}
]
},
"efx:place_and_route": {
"_attributes": {
"tool_name": "efx_pnr"
},
"efx:param": [
{
"_attributes": {
"name": "work_dir",
"value": "prj/work_pnr",
"value_type": "e_string"
}
},
{
"_attributes": {
"name": "verbose",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "load_delaym",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "optimization_level",
"value": "CONGESTION_1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "seed",
"value": "1",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "placer_effort_level",
"value": "1",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "max_threads",
"value": "32",
"value_type": "e_integer"
}
},
{
"_attributes": {
"name": "beneficial_skew",
"value": "on",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "print_critical_path",
"value": "10",
"value_type": "e_integer"
}
}
]
},
"efx:bitstream_generation": {
"_attributes": {
"tool_name": "efx_pgm"
},
"efx:param": [
{
"_attributes": {
"name": "mode",
"value": "active",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "width",
"value": "2",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "cold_boot",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "cascade",
"value": "off",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "enable_roms",
"value": "on",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "spi_low_power_mode",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "io_weak_pullup",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "oscillator_clock_divider",
"value": "DIV8",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "enable_crc_check",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "bitstream_compression",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "active_capture_clk_edge",
"value": "negedge",
"value_type": "e_option"
}
},
{
"_attributes": {
"name": "release_tri_then_reset",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "enable_external_master_clock",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "jtag_usercode",
"value": "0xFFFFFFFF",
"value_type": "e_string"
}
},
{
"_attributes": {
"name": "generate_bit",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "generate_bitbin",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "generate_hex",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "generate_hexbin",
"value": "on",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "four_byte_addressing",
"value": "off",
"value_type": "e_bool"
}
}
]
},
"efx:debugger": {
"efx:param": [
{
"_attributes": {
"name": "work_dir",
"value": "prj/work_dbg",
"value_type": "e_string"
}
},
{
"_attributes": {
"name": "auto_instantiation",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "profile",
"value": "NONE",
"value_type": "e_string"
}
}
]
},
"efx:security": {
"efx:param": [
{
"_attributes": {
"name": "enable_bitstream_encrypt",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "enable_bitstream_auth",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "encryption_key_file",
"value": "NONE",
"value_type": "e_string"
}
},
{
"_attributes": {
"name": "auth_key_file",
"value": "NONE",
"value_type": "e_string"
}
},
{
"_attributes": {
"name": "randomize_iv_value",
"value": "off",
"value_type": "e_bool"
}
},
{
"_attributes": {
"name": "iv_value",
"value": "",
"value_type": "e_string"
}
}
]
}
}
}

View File

@ -5,5 +5,6 @@
"welcome.refuse": "Refuse",
"progress.register-command": "(Digital IDE) Register Command",
"progress.initialization": "(Digital IDE) Initialization",
"progress.build-module-tree": "build module tree"
"progress.build-module-tree": "build module tree",
"fail.save-file": "fail to save file"
}

View File

@ -5,5 +5,6 @@
"welcome.refuse": "Refuse",
"progress.register-command": "(Digital IDE) Register Command",
"progress.initialization": "(Digital IDE) Initialization",
"progress.build-module-tree": "build module tree"
"progress.build-module-tree": "build module tree",
"fail.save-file": "fail to save file"
}

View File

@ -5,5 +5,6 @@
"welcome.refuse": "Refuse",
"progress.register-command": "(Digital IDE) Register Command",
"progress.initialization": "(Digital IDE) Initialization",
"progress.build-module-tree": "build module tree"
"progress.build-module-tree": "build module tree",
"fail.save-file": "fail to save file"
}

View File

@ -1,7 +0,0 @@
set_param general.maxThreads 8
create_project template /home/dide/project/Digital-Test/MipsDesign/prj/xilinx -part none -force
set_property SOURCE_SET source_1 [get_filesets sim_1]
set_property top_lib xil_defaultlib [get_filesets sim_1]
update_compile_order -fileset sim_1 -quiet
source /home/dide/project/Digital-IDE/resources/script/xilinx/refresh.tcl -quiet
file delete /home/dide/project/Digital-IDE/resources/script/xilinx/launch.tcl -force

View File

@ -1,55 +0,0 @@
remove_files -quiet [get_files]
set xip_repo_paths {}
set_property ip_repo_paths $xip_repo_paths [current_project] -quiet
update_ip_catalog -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/Controller/controller.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/Controller/controller.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Hazard/ForwardUnit.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Hazard/ForwardUnit.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Hazard/HDU.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Hazard/HDU.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Memory/dm_8k.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Memory/dm_8k.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Memory/im_8k.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Memory/im_8k.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/EX_MEM.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/EX_MEM.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/ID_EX.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/ID_EX.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/IF_ID.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/IF_ID.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/MEM_WB.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Pipe/MEM_WB.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/BU.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/BU.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/Ext.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/Ext.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/FU.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/FU.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/OR.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/OR.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/alu.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/alu.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/alu_ctrl.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/alu_ctrl.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/mux.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/mux.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/npc.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/npc.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/pc.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/pc.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/pc_add.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/pc_add.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/regfile.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/Utils/regfile.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/DataPath/datapath.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/DataPath/datapath.v -quiet
add_files /home/dide/project/Digital-Test/MipsDesign/src/MyCpu.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/src/MyCpu.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-Test/MipsDesign/sim/testBench.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-IDE/library/Apply/Comm/FDE/AGC/AGC.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-IDE/library/Apply/Comm/MDS/Modulation/AnalogMod.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-IDE/library/Apply/Comm/MDS/Modulation/DigitalMod.v -quiet
add_files -fileset sim_1 /home/dide/project/Digital-IDE/library/Basic/Math/FixedPoint/accuml.v -quiet
add_files -fileset constrs_1 /home/dide/project/Digital-Test/MipsDesign -quiet
file delete /home/dide/project/Digital-IDE/resources/script/xilinx/refresh.tcl -force

View File

@ -74,6 +74,8 @@ async function transformOldPpy() {
}
async function askUserToSaveFilelist(filelist: string[]) {
const { t } = vscode.l10n;
const topModulePath = filelist[0];
const defaultSaveName = fspath.basename(topModulePath, fspath.extname(topModulePath));
const defaultSavePath = hdlPath.join(opeParam.workspacePath, defaultSaveName + '.f');
@ -86,7 +88,18 @@ async function askUserToSaveFilelist(filelist: string[]) {
defaultUri: vscode.Uri.file(defaultSavePath)
});
if (uri === undefined) {
return;
}
const filePath = uri.path;
const fileContent = filelist.join('\n');
try {
fs.writeFileSync(filePath, fileContent);
} catch (error) {
vscode.window.showErrorMessage(t('fail.save-file') + ': ' + error);
}
}
/**
@ -102,7 +115,7 @@ function exportFilelist(view: ModuleDataItem) {
deps.include.forEach(path => fileset.add(path));
const filelist = [view.path];
filelist.push(...fileset);
askUserToSaveFilelist(filelist);
} else {
vscode.window.showErrorMessage('fail to get deps of view ' + view.name);
}

View File

@ -5,12 +5,18 @@ import { hardwareTreeProvider, softwareTreeProvider, toolTreeProvider } from './
import { moduleTreeProvider, ModuleDataItem } from './tree';
import { Range } from '../../hdlParser/common';
async function openFileAtPosition(uri: vscode.Uri, line: number, character: number) {
async function openFileAtPosition(uri: vscode.Uri, range: Range) {
const document = await vscode.workspace.openTextDocument(uri);
const editor = await vscode.window.showTextDocument(document);
const position = new vscode.Position(line, character);
editor.selection = new vscode.Selection(position, position);
editor.revealRange(new vscode.Range(position, position));
const start = new vscode.Position(range.start.line - 1, range.start.character - 1);
const end = new vscode.Position(range.end.line - 1, range.end.character - 1);
await vscode.window.showTextDocument(
document,
{
selection: new vscode.Range(start, end)
}
);
}
function openFileByUri(path: string, range: Range) {
@ -18,10 +24,10 @@ function openFileByUri(path: string, range: Range) {
vscode.window.showErrorMessage(`${path} not support jump yet`);
return;
}
if (hdlPath.exist(path)) {
const uri = vscode.Uri.file(path);
const start = range.start;
openFileAtPosition(uri, start.line - 1, start.character);
openFileAtPosition(uri, range);
}
}

View File

@ -247,33 +247,45 @@ class HdlParam {
let fileNum = hdlFiles.length;
const parallelChunk = 5;
const pools: { id: number, promise: Promise<void> }[] = [];
const pools: { id: number, promise: Promise<void>, path: string }[] = [];
const reportTitle = t('progress.build-module-tree');
async function consumePools() {
for (const p of pools) {
const increment = Math.floor(p.id / fileNum * 100);
await p.promise;
console.log("handle id " + p.id + ' increment: ' + increment);
progress?.report({ message: reportTitle + ` ${p.id}/${fileNum}`, increment });
}
pools.length = 0;
}
progress?.report({ message: reportTitle + ` ${1}/${fileNum}`, increment: 0 });
for (const path of hdlFiles) {
count ++;
const p = this.doHdlFast(path);
pools.push({ id: count, promise: p });
if (pools.length % parallelChunk === 0) {
// 消费并发池
await consumePools();
}
console.log('send request: ' + path);
await this.doHdlFast(path);
console.log('finish request: ' + path);
}
if (pools.length > 0) {
await consumePools();
}
// async function consumePools() {
// for (const p of pools) {
// const increment = Math.floor(p.id / fileNum * 100);
// console.log('wait ' + p.path);
// await p.promise;
// console.log("handle id " + p.id + ' increment: ' + increment);
// progress?.report({ message: reportTitle + ` ${p.id}/${fileNum}`, increment });
// }
// pools.length = 0;
// }
// for (const path of hdlFiles) {
// count ++;
// console.log('send request: ' + path);
// const p = this.doHdlFast(path);
// pools.push({ id: count, promise: p, path });
// if (pools.length % parallelChunk === 0) {
// // 消费并发池
// await consumePools();
// }
// }
// if (pools.length > 0) {
// await consumePools();
// }
}

View File