Merge commit '08dd312'

This commit is contained in:
Nitcloud 2025-03-09 15:48:52 +08:00
commit 2b1e9d7b00
50 changed files with 3159 additions and 1332 deletions

View File

@ -0,0 +1,89 @@
name: 报告 Bug
description: 向我们报告 Bug。
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
投我以木桃,报之以琼瑶。
填写之前请阅读 [nc-ai | 关于反馈](https://nc-ai.cn/article/cxnqr517/#%E5%85%B3%E4%BA%8E%E5%8F%8D%E9%A6%88)
- type: dropdown
id: os
attributes:
label: 操作系统
description: 您在什么操作系统上运行?
options:
- Windows
- Mac
- Linux
- 其他
default: 0
validations:
required: true
- type: dropdown
id: chip
attributes:
label: 芯片架构
description: 您在什么架构的芯片上运行?
options:
- x86
- arm
- loongson
- 其他
default: 0
validations:
required: true
- type: dropdown
id: connect
attributes:
label: 运行方式
description: 您采用何种方式运行?
options:
- 桌面运行
- SSH 远程连接
- WSL2
- 虚拟机
- 其他
default: 0
validations:
required: true
- type: input
id: vscode-version
attributes:
label: Vscode / Vscodium 版本
placeholder: "1.96.2"
validations:
required: true
- type: input
id: dide-version
attributes:
label: Digital IDE 版本
placeholder: "0.4.0"
validations:
required: true
- type: textarea
id: meet-question
attributes:
label: 你遇到的问题
validations:
required: true
- type: textarea
id: expect
attributes:
label: 你希望的运行结果
validations:
required: false
- type: textarea
id: actual
attributes:
label: 实际的运行结果
validations:
required: false
- type: textarea
id: log
attributes:
label: 运行日志
render: shell
validations:
required: false

89
.github/ISSUE_TEMPLATE/bug-report.yaml vendored Normal file
View File

@ -0,0 +1,89 @@
name: Bug Report
description: Report a bug to us.
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
"You give me a peach, I repay you with a jade."
Please read [nc-ai | About Feedback](https://nc-ai.cn/article/cxnqr517/#%E5%85%B3%E4%BA%8E%E5%8F%8D%E9%A6%88) before filling out this form.
- type: dropdown
id: os
attributes:
label: Operating System
description: What operating system are you running on?
options:
- Windows
- Mac
- Linux
- Other
default: 0
validations:
required: true
- type: dropdown
id: chip
attributes:
label: Chip Architecture
description: What chip architecture are you running on?
options:
- x86
- arm
- loongson
- Other
default: 0
validations:
required: true
- type: dropdown
id: connect
attributes:
label: Running Method
description: How are you running the software?
options:
- Desktop
- SSH Remote Connection
- WSL2
- Virtual Machine
- Other
default: 0
validations:
required: true
- type: input
id: vscode-version
attributes:
label: Vscode / Vscodium Version
placeholder: "1.96.2"
validations:
required: true
- type: input
id: dide-version
attributes:
label: Digital IDE Version
placeholder: "0.4.0"
validations:
required: true
- type: textarea
id: meet-question
attributes:
label: Issue You Encountered
validations:
required: true
- type: textarea
id: expect
attributes:
label: Expected Result
validations:
required: false
- type: textarea
id: actual
attributes:
label: Actual Result
validations:
required: false
- type: textarea
id: log
attributes:
label: Runtime Log
render: shell
validations:
required: false

View File

@ -1,12 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
"out": false
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
"out": true
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"i18n-haru.root": "l10n",
"i18n-haru.main": "zh-cn",

View File

@ -2,6 +2,8 @@
.gitignore
**/.gitignore
.git
.github
doc
**/*.map
.eslintrc.json
dist
@ -13,6 +15,7 @@ script
resources/**/*.js
resources/**/*.d.ts
resources/**/*.wasm
resources/**/*.tar.gz
resources/dide-lsp/server
tsconfig.json
design

View File

@ -4,48 +4,50 @@
## <code>Digital IDE</code> | All in one <code>vscode</code> plugin for Verilog/VHDL development
[Document (New)](https://nc-ai.cn/en/) | [中文文档 (New)](https://nc-ai.cn/) | [Bilibili Video](https://www.bilibili.com/video/BV1t14y1179V/?spm_id_from=333.999.0.0)
[Document (New)](https://nc-ai.cn/) | [中文文档 (New)](https://nc-ai.cn/zh/) | [Bilibili Video](https://www.bilibili.com/video/BV1L19HYcEz6/?spm_id_from=333.1387.list.card_archive.click) | [Github](https://github.com/Digital-EDA/Digital-IDE)
![](https://img.shields.io/badge/version-0.4.0-purple)
![](https://img.shields.io/badge/version-0.4.2-purple)
![](https://img.shields.io/badge/Verilog-support-green)
![](https://img.shields.io/badge/VHDL-support-green)
![](https://img.shields.io/badge/SystemVerilog-support-green)
</div>
## 0.4.0 新增内容
## Features
**使用 Rust 重写全新的解析器与语言服务**:支持 verilog, vhdl, system verilog性能更快服务更加稳定。
**Rewritten Parser and Language Services in Rust**: Supports Verilog, VHDL, and SystemVerilog with faster performance and more stable services.
![](./figures/lsp.png)
**修缮内容的文档化**:提供更加直接快速的,关于当前 HDL 文件的基本信息和依赖信息。支持 wavedrom 风格的注释并支持将其渲染成可视化的图表。
**Improved Documentation**: Provides more direct and faster access to basic information and dependencies of the current HDL file. Supports Wavedrom-style comments and renders them into visual diagrams.
![](./figures/doc.png)
**新增内容的 Vcd 渲染器**:增加顶部工具栏、系统信标等组件;支持左侧面板选定信号的拖拽、分组等功能、支持按住 shift 连续选中一片信号并进行增加和删除操作;支持基于系统信标建立相对坐标系;顶部工具栏支持选中信号的显示数字的进制转换,渲染模态切换,支持将信号渲染为模拟量。
**New VCD Renderer**: Added top toolbar, system beacon, and other components; supports drag-and-drop and grouping of selected signals in the left panel, as well as selecting multiple signals by holding Shift for addition and deletion; supports establishing a relative coordinate system based on system beacons; the top toolbar supports base conversion for displayed numbers of selected signals, rendering mode switching, and rendering signals as analog values.
![](./figures/vcd.png)
- 全新的 Netlist 渲染器
- Brand New Netlist Renderer
![](./figures/netlist.png)
## Feature
- 增加对于 vhdl 的 全面支持文件树、LSP等
- 增加 verilog, vhdl, xdc, tcl, vvp, vcd 等语言或生成文件的工作区图标
- 增加对于 vivado, modelsim, verilator 的支持,用户可以通过设置 `function.lsp.linter.vhdl.diagnostor`(设置 vhdl) 和 `function.lsp.linter.vlog.diagnostor`(设置 verilog) 来使用这些第三方工具的仿真和自动纠错。
- 增加对于 TCL, XDC, VVP 等脚本的 LSP 和 语法高亮 支持。
## New 0.4.2
- Added comprehensive support for VHDL & SV (file tree, LSP, etc.)
- Added workspace icons for languages or generated files such as Verilog, VHDL, XDC, TCL, VVP, VCD, etc.
- Added support for Vivado, ModelSim, and Verilator. Users can use these third-party tools for simulation and auto-correction by setting `function.lsp.linter.vhdl.diagnostor` (for VHDL) and `function.lsp.linter.vlog.diagnostor` (for Verilog).
- Added LSP and syntax highlighting support for scripts like TCL, XDC, and VVP.
## Change
- 将插件的工作状态显示在 vscode 下侧的状态栏上,利于用户了解目前的设置状态
- 状态栏右下角现在可以看到目前选择的linter以及是否正常工作了
- 优化项目配置目录
- 优化自动补全的性能
## Changes
- Display the plugin's working status in the status bar at the bottom of VSCode, making it easier for users to understand the current settings.
- The bottom-right corner of the status bar now shows the currently selected linter and whether it is functioning properly.
- Optimized project configuration directory.
- Improved auto-completion performance.
## Bug 修复
- 修复文档化 input, output 处注释无法正常显示到文档的 bug
- 修复 iverilog 仿真功能中,将重复的路径作为编译参数编译的 bug
- 修复 iverilog 仿真功能中,将 <code>`include</code> 加入或去除后,无法通过仿真编译的 bug (没有更新 instance 的 instModPathStatus 属性)
- 修复其他已知 bug
## Bug Fixes
- Fixed a bug where comments on `input` and `output` were not displayed correctly in the documentation.
- Fixed a bug in the Icarus Verilog simulation feature where duplicate paths were included as compilation parameters.
- Fixed a bug in the Icarus Verilog simulation feature where adding or removing <code>include</code> would cause simulation compilation to fail (the `instModPathStatus` property of the instance was not updated).
- Fixed simulation issues with Icarus Verilog version 12
- Fixed the issue of being unable to import Block Design (BD) during Vivado project generation
- Fixed the issue where libraries in custom mode could not be imported into Vivado
- Fixed other known bugs.

View File

@ -126,5 +126,10 @@
"info.pdf.exporting": "PDF wird nach {0} exportiert",
"info.generate-pdf-to": "PDF wurde unter {0} generiert",
"info.vivado-gui.started": "Vivado GUI wird gestartet, bitte warten Sie einen Moment",
"ok": "Gut"
"ok": "Gut",
"netlist.save-as-markdown": "Als Markdown speichern",
"markdown-file": "Markdown-Datei",
"toolbar.save-as-html": "Als HTML speichern",
"html-file": "HTML-Datei",
"dide-doc.error.loading-html": "Digital CodeDoc-Ressourcen konnten nicht geladen werden, das Installationsverzeichnis ist beschädigt. Bitte installieren Sie das Programm neu!"
}

View File

@ -126,5 +126,10 @@
"info.pdf.exporting": "Exporting PDF to {0}",
"info.generate-pdf-to": "PDF has been generated to {0}",
"info.vivado-gui.started": "Vivado GUI is starting, please wait a moment",
"ok": "Good"
"ok": "Good",
"netlist.save-as-markdown": "Save as Markdown",
"markdown-file": "Markdown file",
"toolbar.save-as-html": "Save as HTML",
"html-file": "HTML file",
"dide-doc.error.loading-html": "Digital CodeDoc resource loading failed, the installation directory is corrupted, please reinstall!"
}

View File

@ -126,5 +126,10 @@
"info.pdf.exporting": "PDFを{0}にエクスポート中",
"info.generate-pdf-to": "PDFは{0}に生成されました",
"info.vivado-gui.started": "Vivado GUI を起動しています、少々お待ちください",
"ok": "良い"
"ok": "良い",
"netlist.save-as-markdown": "Markdownとして保存",
"markdown-file": "Markdownファイル",
"toolbar.save-as-html": "HTMLとして保存",
"html-file": "HTMLファイル",
"dide-doc.error.loading-html": "Digital CodeDoc リソースの読み込みに失敗しました。インストールディレクトリが破損しています。再インストールしてください!"
}

View File

@ -126,5 +126,10 @@
"info.pdf.exporting": "正在导出 pdf 到 {0}",
"info.generate-pdf-to": "pdf 已经生成至 {0}",
"info.vivado-gui.started": "Vivado GUI 正在启动中,稍等片刻",
"ok": "好的"
"ok": "好的",
"netlist.save-as-markdown": "保存为 Markdown",
"markdown-file": "Markdown 文件",
"toolbar.save-as-html": "保存为 HTML",
"html-file": "HTML 文件",
"dide-doc.error.loading-html": "Digital CodeDoc 资源加载失败,安装目录已经损坏,请重新安装!"
}

View File

@ -126,5 +126,10 @@
"info.pdf.exporting": "正在導出PDF到{0}",
"info.generate-pdf-to": "PDF 已生成至 {0}",
"info.vivado-gui.started": "Vivado GUI 正在啟動中,稍等片刻",
"ok": "好的"
"ok": "好的",
"netlist.save-as-markdown": "儲存為 Markdown",
"markdown-file": "Markdown 檔案",
"toolbar.save-as-html": "保存為HTML",
"html-file": "HTML檔案",
"dide-doc.error.loading-html": "Digital CodeDoc 資源加載失敗,安裝目錄已經損壞,請重新安裝!"
}

2623
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,12 +4,12 @@
"description": "all in one vscode plugin for Verilog/VHDL development",
"publisher": "sterben",
"homepage": "https://digital-eda.github.io/DIDE-doc-Cn",
"version": "0.4.1",
"version": "0.4.2",
"main": "./out/extension",
"l10n": "./l10n",
"icon": "images/icon.png",
"engines": {
"vscode": "^1.89.0"
"vscode": "^1.85.0"
},
"keywords": [
"FPGA Develop Support",
@ -1256,6 +1256,7 @@
"@types/pako": "^2.0.3",
"@types/showdown": "^2.0.0",
"@types/vscode": "^1.72.0",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@vscode/test-electron": "^2.2.0",
@ -1271,9 +1272,9 @@
"chokidar": "^4.0.1",
"minimatch": "^10.0.1",
"pako": "^2.1.0",
"puppeteer-core": "^19.4.1",
"puppeteer-core": "^24.4.0",
"showdown": "^2.1.0",
"state-machine-cat": "^9.2.5",
"state-machine-cat": "^12.0.21",
"tar": "^7.4.3",
"temp": "^0.9.4",
"utf-8-validate": "^5.0.10",
@ -1281,7 +1282,7 @@
"vscode-languageclient": "^9.0.1",
"vscode-textmate": "^9.0.0",
"wavedrom": "^2.9.1",
"webpack": "^5.98.0",
"xml2js": "^0.6.2",
"zlib": "^1.0.5"
}
}

View File

@ -0,0 +1,6 @@
dide-doc
- view
- index.html
- css
- js
- ...

View File

@ -1,43 +0,0 @@
@font-face {
font-family: "iconfont"; /* Project id 4748764 */
src: url('iconfont.woff2?t=1731914985969') format('woff2'),
url('iconfont.woff?t=1731914985969') format('woff'),
url('iconfont.ttf?t=1731914985969') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-tree:before {
content: "\e601";
}
.icon-verilog:before {
content: "\e634";
}
.icon-top-module:before {
content: "\e682";
}
.icon-top:before {
content: "\e600";
}
.icon-parameter:before {
content: "\e655";
}
.icon-unknown:before {
content: "\e62a";
}
.icon-port:before {
content: "\e638";
}

Binary file not shown.

View File

@ -1,65 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital IDE Document</title>
<link rel="icon" href="icon.png">
<link rel="stylesheet" href="documentation.css">
<link rel="stylesheet" href="iconfont.css">
</head>
<body>
<div id="wrapper">
<div id="write"></div>
</div>
</body>
<script>
const vscode = acquireVsCodeApi();
function enableHrefVscodeOpen() {
// 自定义超链接
document.querySelectorAll('a').forEach(link => {
link.addEventListener('click', (event) => {
event.preventDefault();
const href = link.getAttribute('href');
if (href.startsWith('file://')) {
vscode.postMessage({
command: 'openFile',
filePath: href
});
}
});
});
}
window.addEventListener('message', event => {
const response = event.data;
const { command, body } = response;
switch (command) {
case 'do-render':
doRender(body);
break;
default:
break;
}
});
window.onload = async () => {
vscode.postMessage({
command: 'do-render'
});
}
function doRender(body) {
document.getElementById('write').innerHTML = body;
enableHrefVscodeOpen();
}
</script>
</html>

View File

@ -1,42 +0,0 @@
import requests as r
import os
import shutil
import zipfile
# 下载 压缩包
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
'Cookie': 'cna=FeNcHjgPWA8CAXU/P9lD8IsF; EGG_SESS_ICONFONT=Hu68kBY7XO7C6Udp3T99M1asKmUZ0gxjps8xjTrjx4ZtNCIR_nFu9Li15nxoPAWLmGlcEMN2KEQyAvgBfASR3cSsmd2lhqg89lUmApzbWgBgCWjMwMzjawMqh2KNT8kCICxit3iWC7YLdUuCdUfXg_cGkRjPNvDohqyeHF27gTb5CloBSvLjqN45PcUvcUig; ctoken=Ku-GfnHTFQU6ObMjjX4rrwYn; u=10114852; u.sig=mv5vi-TPPlhvQJi2PMIC4VoPpD03Wc9UykMTMiG6ElA; xlly_s=1; tfstk=fSrIwBNqyBACtg2sZ2BZ5BUbpIn7PWsVNLM8n8KeeDnpwQex_JrEY887N5wxykyrvui717NU8DUUPYN4p7glKbl-N7y88OSV0J2nq0K5giSVfSIC9W9pv3B-6YMoT58eCJ2nqdvwwZzTKU6xnQBS27ntXvkj2HHKwO9tnfKKeHHJ6OMo6bn-9v39XxMD9e3Kpbdy1Y7IeJ69Kr6y7I-gLftJcKDKJZyez3-yav0nMVh62Arsd2GYpk3XwyMTblgq7L5ZX-4a9AifbenYCzFbk7b2SDw8J70_t1Ys_PE3eb3wenysPXaTvV9J2RmsN447O6Tn9yPsoA39FiDagfe3vP6k6JFqODHt7iBbB4UaxqqF6HiYoJoUy7b2SDw8JcszunlfpXTWCqxSCjW1CUYrE4jk1CVx8l3KIvIVCOO6r2HiCjW1CUYoJADLuO661Uf..; isg=BCwsfWsQZki1QXEWw0jCCc4h_Qpe5dCP-aVamIZsF1d6kc6br_ZyHmFnsVkpGQjn',
'Pragma': 'no-cache',
'sec-fetch-mode': 'navigate'
}
url = 'https://www.iconfont.cn/api/project/download.zip?spm=a313x.manage_type_myprojects.i1.d7543c303.21213a81tE9WyY&pid=4748764&ctoken=QcRJGHx0m7kL39pW1Slgy_E8'
res = r.get(url, headers=headers)
if res.status_code:
with open('./script/tmp.zip', 'wb') as fp:
fp.write(res.content)
# 解压文件
with zipfile.ZipFile('./script/tmp.zip', 'r') as zipf:
zipf.extractall('./script/tmp')
# 将文件搬运至工作区,我的 css 全放在 public 下面了,你的视情况而定
for parent, _, files in os.walk('./script/tmp'):
for file in files:
filepath = os.path.join(parent, file)
if file.startswith('demo'):
continue
if file.endswith('.css'):
content = open(filepath, 'r', encoding='utf-8').read().replace('font-size: 16px;', '')
open(filepath, 'w', encoding='utf-8').write(content)
shutil.move(filepath, os.path.join('./resources/dide-doc', file))
elif file.endswith('.woff2'):
shutil.move(filepath, os.path.join('./resources/dide-doc', file))
# 删除压缩包和解压区域
os.remove('./script/tmp.zip')
shutil.rmtree('./script/tmp')

Binary file not shown.

View File

@ -0,0 +1,127 @@
:root {
--main-during: 0.35s;
--fade-during: .5s;
}
.fade-animation-effect {
transition: var(--animation-5s);
-webkit-transition: var(--animation-5s);
-ms-transition: var(--animation-5s);
}
.easy-hidden {
visibility: hidden;
}
.main-fade-enter-from,
.main-fade-leave-to {
opacity: 0;
}
.main-fade-enter-to,
.main-fade-leave-from {
opacity: 1;
}
.main-fade-enter-active,
.main-fade-leave-active {
transition: opacity var(--main-during);
-moz-transition: opacity var(--main-during);
-webkit-transition: opacity var(--main-during);
}
.slide-enter-active,
.slide-leave-active {
transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
-webkit-transition: all .5s ease-out;
}
.slide-enter-from {
position: relative;
transform: translateY(-100px);
opacity: 0%;
}
.slide-leave-to {
transform: translateY(100px);
opacity: 0%;
}
.slide-down-enter-active,
.slide-down-leave-active {
transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
-webkit-transition: all .5s ease-out;
}
.slide-down-enter-from {
position: relative;
transform: translateY(100px);
opacity: 0%;
}
.slide-down-leave-to {
transform: translateY(100px);
opacity: 0%;
}
.slide-up-enter-active,
.slide-up-leave-active {
transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
-webkit-transition: all .5s ease-out;
}
.slide-up-enter-from {
position: relative;
transform: translateY(-100px);
opacity: 0%;
}
.slide-up-leave-to {
transform: translateY(-100px);
opacity: 0%;
}
.collapse-from-top-enter-active,
.collapse-from-top-leave-active {
transition: var(--animation-3s);
-moz-transition: var(--animation-3s);
-webkit-transition: var(--animation-3s);
}
.collapse-from-top-enter-from {
transform: scaleY(0);
transform-origin: center top;
opacity: 0%;
}
.collapse-from-top-leave-to {
transform: scaleY(0);
transform-origin: center top;
opacity: 0%;
}
@keyframes loading-mask {
0% {
background-position: 100% 50%;
}
100% {
background-position: 0 50%;
}
}
@keyframes word-jump {
0% {
transform: translateY(0);
}
20% {
transform: translateY(-5px);
}
80% {
transform: translateY(2px);
}
100% {
transform: translateY(0px);
}
}
.fast-transition {
transition: var(--animation-3s);
}

View File

@ -1,15 +1,138 @@
:root {
--dark-main-color : #df733d;
--light-main-color : #cc6633;
--display-signal-info-height: 50px;
--signal-default-color: #4CAF50;
--main-color: #CB81DA;
--main-transplate-color: rgba(203, 129, 208, 0.1);
--main-hover-color: rgba(203, 129, 208, 0.5);
--shadow-color: rgba(139, 73, 225, 0.99);
--main-dark-color: #2D323B;
--main-light-color: var(--main-color);
--monospace-font: "Cascadia code", monospace;
--dark-theme-border: 1px solid rgba(242, 242, 242, 0.3);
--light-theme-border: 1px solid rgba(142, 142, 142, 0.3);
/* css 动画属性 */
--animation-7s: .7s cubic-bezier(0.23,1,0.32,1);
--animation-5s: .5s cubic-bezier(0.23,1,0.32,1);
--animation-3s: .35s cubic-bezier(0.23,1,0.32,1);
--gray-box-shadow-0: 0 0 8px 3px rgba(182, 181, 182, 0.9);
--gray-box-shadow-1: 0 0 5px 1px rgba(16, 16, 16, 0.5);
}
@font-face {
font-family: "Cascadia code";
src: url("./CascadiaCode.woff2");
}
html, body {
background-color: var(--background);
color: var(--foreground);
}
*::selection {
background-color: var(--main-hover-color) !important;
}
body::-webkit-scrollbar {
width: 0;
}
* hr {
border: none;
background-color: var(--main-color);
height: 1.5px;
width: 95%;
}
/*
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
background: var(--sidebar);
}
::-webkit-scrollbar-thumb {
background: var(--scrollbar-background);
border-radius: .3em;
}
::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-hover);
border-radius: .3em;
}
::-webkit-scrollbar-thumb:active {
background: var(--scrollbar-active);
border-radius: .3em;
}
::-webkit-scrollbar-button {
height: 0;
width: 0;
}
::-webkit-scrollbar-corner {
background: none;
display: none;
} */
.el-select__wrapper {
min-width: 100px;
padding: 13px;
color: var(--sidebar-item-text);
}
.el-select-group__title {
color: var(--main-color) !important;
}
.el-select__placeholder {
color: var(--sidebar-item-text) !important;
}
.el-select-dropdown {
background-color: var(--sidebar);
border: 1.0px solid var(--main-color);
}
.el-checkbox-button__inner {
font-size: 16px !important;
}
a {
color: var(--main-color);
}
.digital-ide-icon {
background-image: url(./icon.svg);
background-size: 100%;
height: 50px;
width: 50px;
}
.digital-ide-icon.big {
background-image: url(./icon.svg);
background-size: 100%;
height: 150px;
width: 150px;
}
.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner {
opacity: 0.6;
}
.el-select__wrapper.is-disabled {
opacity: 0.6;
box-shadow: unset !important;
}
body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
line-height: 1.5;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.5;
word-wrap: break-word;
background-attachment: fixed;
@ -37,8 +160,8 @@ a {
}
#write {
padding: 15px 30px;
width: 1000px;
padding: 10px;
width: 800px;
}
.ImgCaption {
@ -435,27 +558,6 @@ li+li {
margin-top: 0.25em;
}
/*
table {
display: block;
width: 100%;
overflow: auto;
}
table th {
font-weight: bold;
}
table th,
table td {
padding: 6px 13px;
border: .7px solid;
}
table tr {
border-top: .7px solid;
} */
img {
max-width: 100%;
@ -479,16 +581,13 @@ img {
#write table thead th {
/* background-color: var(--dark-main-color); */
font-size: 20px;
font-weight: bolder;
width: 100px;
text-align: center;
vertical-align: middle;
padding: 10px;
}
.vscode-dark table {
color: #F0F0F0;
color: var(--vscode-foreground);
}
.vscode-light table {
@ -595,7 +694,7 @@ img {
padding-left: 0;
padding: 20px 0px;
margin: 10px 0 10px 0px;
width: 105px;
width: 95px;
}
.diagram-container .arrow-wrapper {
@ -672,6 +771,106 @@ img {
background-color: #a09c9c;
}
#write table, th, td {
border: 1px solid var(--vscode-foreground) !important;
}
.vscode-dark table, th, td {
border: 1px solid rgba(242, 242, 242, 0.1) !important;
}
.vscode-light table, th, td {
border: 1px solid rgba(142, 142, 142, 0.1) !important;
}
/* #write table, th {
border-bottom: 1px solid rgb(76, 55, 114) !important;
} */
/* #write table, td {
border-bottom: 1px solid rgba(242, 242, 242, 0.3) !important;
} */
#write table {
border-radius: .3em;
}
.left-align {
text-align: left;
}
.markdown-ext-block {
border-radius: .3em;
border: 1px solid var(--main-color);
background-color: var(--main-transplate-color);
padding: 3px 15px;
margin-bottom: 25px;
}
.markdown-ext-block .iconfont {
font-size: 1.2rem;
margin-right: .7rem;
color: var(--main-color);
}
.markdown-ext-block .title {
color: var(--main-color);
font-weight: 700;
font-size: 1.3rem;
letter-spacing: unset;
line-height: unset;
}
.markdown-ext-block .desc {
color: black;
font-weight: 700;
margin-left: .7rem;
}
.pre-dot::before {
content: "";
display: inline-table;
width: 12px;
height: 12px;
margin-right: 7px;
background-color: var(--main-color);
border-radius: .5em;
}
pre {
-webkit-overflow-scrolling: touch;
font-family: var(--monospace-font), "Courier New", monospace;
font-size: 0.9em;
margin: 0 0 2em 0;
position: relative;
}
pre > code {
display: block;
line-height: 1.75;
padding: 1em 1.5em;
overflow-x: auto;
border-top: rgba(230, 235, 237, 0) solid 35px;
background-color: var(--vscode-textCodeBlock-background);
border-radius: .3em;
font-family: var(--monospace-font), "Courier New", monospace;
font-size: 15px;
margin: 0 0.25em;
transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
}
pre > code:before {
content: "";
background: var(--shadow-color);
box-shadow: 23px 0 #b6bdc9, 45px 0 #b6bdc9;
border-radius: 50%;
margin-top: -36px;
margin-left: -6px;
position: absolute;
height: 13px;
width: 13px;
}
.el-popper {
color: white !important;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,42 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
width="126px" height="126px" viewBox="-0.5 -0.5 126 126"
content="&lt;mxfile&gt;&lt;diagram id=&quot;E9SxX19eNgA6MUTyjjO6&quot; name=&quot;Icon-黑白&quot;&gt;7VnbktsoEP0aP0YlhG5+HF/GqVSS8pZrd2f3xcVIWGJXEiqEx3K+fsFCN8sXORnNuJL1g003TQN9DtDgEZzG+YKhNPxCfRyNDN3PR3A2MgzoOOJbKvaFwjDNQhEw4hcqUCtW5BtWSl1pt8THWcuQUxpxkraVHk0S7PGWDjFGd22zDY3avaYowB3FykNRV/sn8XmotMAe1xUfMQlC1bVrqAnHqDRWM8lC5NNdQwXnIzhllPKiFOdTHMnYlXHxJ7s5fqSf7OfpbvVp7cXpYv2hcPZ4S5NqCgwn/HVdw8L1C4q2Kl5qrnxfBnAXEo5XKfKkvBMcGcFJyONISEAUUZYWsG1IjkVXkw2JoimNKDs0h8YMGnAi9Bln9N8KA0ta0oQ3LDeHT2VZ1iQ0ET1PGN0mvuyg6JV5imrAFWLPAKlAvmDGcd6ghwrYAtMYc7YXJqrWtBX2JflLedegUsmPsMGiSokUfYPKdw2RKCiUbkDMfC/EYG/ERM104oLZwwXYLH1I2FyoOVYbuYaqAZ5jaFYXvVr76vDZ1+ETXsTmKDl/K5BtwIwutBUs5wELGPIJrmFWy2+4FeZobaSgVWmaq+wETGAokJx7B2koNCzrDtFw/0ejPn/eEo08X23Th+zzxPqbzBe7cGIbf/TZwAKx6adVXDrzrXI99Fy20G8J4fm9ZHzEXb17WlsnYgWHYu74eqxkdIjIVj+jZxwtaUY4oYmoeqac01jSrsw65YHpoyw8HKZSQBEJpKknYoZZm+el2wdlw2la+Eplv3EeyFxfw5FAgUk7LaIB8dYB4jhrlEUbmmKG1KBQMtySuUi23kumjLBiADA1B9quKW4jlmFDYHf4AOGJteNqVQvLccdD0QOA6/y4OZcTGdojikkkIzClMfGEvxVKMvHzZaUMVA7mdsAER2D6eIO2ER8CsOb+BU5gAIYKuvELB708RgzNAWNj7BqmZQNTh2b3THlTTJzuie6LW7wSKeMhDWiConmtbdws9DY8OCf8Sall+S9Zlsl/Ic7yRt1s3xCWmBExIbmXFrpETO6p9CqFwpVVirWrg1T6uoUOAB6a+w/yqaNOt4XmkcggHhye30e7e/FtnMnolnn4+hHGEQvwxZNZrSKJ20UKMhyJ4+Sl/TrzI4zS7309j2QiIj+nkKxqfsK1fvfH2zsh8wahPznCIR77XhuP3rnjiWtFP4juB48hnvJ+Bjzef+c6OVpriCSlLDcyi/M5SpmPVELRyriWkByk4+zmVqq8fpJylCt8P2F65xSHpmIWaN8wSClJeNbwvJSK+k4J7KNXGFuTbLR011H8bFLrenMw1mxzDAzD1R0dOJZpHVGzGOAZb6DHUKqpFemdcnFhjMfX5rEGWzdgs+22yAY7bg+rqoKl10Lzflt8s5++muuPH5bW+vf863LzT59z6h4e/K7seN/zgNV5DB/0wU+I9b+XBXj1X8Bw/h8=&lt;/diagram&gt;&lt;diagram id=&quot;2oZjiazD9LnPP1Vpl2Fo&quot; name=&quot;第 2 页&quot;&gt;5ZZdb4IwFEB/DY8m0DLQV5m6h7nEuGXPDVToVigpVXC/fkUuX+Lilui2RF+k515u29ObBgN7cbGQJI2WIqDcQGZQGPjeQAiZeKL/SrKviGU6qCKhZAGwFqzZB60TgW5ZQLNeohKCK5b2oS+ShPqqx4iUIu+nbQTvz5qSEGY0W7D2CaeDtFcWqKiiY+S2/IGyMKpnthzYcUzqZCicRSQQeQfhmYE9KYSqnuLCo7y0V3up3pt/EW0WJmmivvNCulw+b3YrwlZPycub9Tgd52oEVXaEb2HDsFi1rw1IsU0CWhaxDDzNI6boOiV+Gc31oWsWqZhDeMM49wQXUo8TkeikaaakeG/kIVuj4dLrdVCpaNFBsJUFFTFVcq9TIDqyXPAKnYVtGOftMWEMLOocUQMJtEbYFG/t6QcQ+AOZ6NdlmheS6Y57Lm2MBi4t2xm6bODFXeLzLnUVfQvQ8x5JllZXw4YVpfsji+Mj1QbC88OvyTwVuUgP20c97A572D7Rwva1OvjuBqxP/plz5/acO+YfO3dvwPngdrmidT1sP2QOsc73IJ59Ag==&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs />
<g>
<rect x="2" y="2" width="120" height="120" rx="21.6" ry="21.6" fill="#2d323b" stroke="none"
pointer-events="all" />
<rect x="25.75" y="25.75" width="72.5" height="72.5" rx="36.25" ry="36.25" fill="#2d323b"
stroke="#cb81da" stroke-width="3" pointer-events="all" />
<ellipse cx="17" cy="107" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
stroke="#cb81da" stroke-width="2" pointer-events="all" />
<ellipse cx="107" cy="107" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
stroke="#cb81da" stroke-width="2" pointer-events="all" />
<ellipse cx="107" cy="17" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
stroke="#cb81da" stroke-width="2" pointer-events="all" />
<path d="M 85.4 65.95 L 92 65.95 M 59 61.34 L 65.6 61.34 M 59 70.55 L 65.6 70.55"
fill="none" stroke="#cb81da" stroke-width="2" stroke-miterlimit="10"
pointer-events="none" />
<path
d="M 65.6 56.74 L 75.5 56.74 C 80.97 56.74 85.4 60.86 85.4 65.95 C 85.4 71.03 80.97 75.16 75.5 75.16 L 65.6 75.16 Z"
fill="#cb81da" stroke="#cb81da" stroke-width="2" stroke-miterlimit="10"
pointer-events="none" />
<rect x="37" y="42" width="11" height="11" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)"
pointer-events="none" />
<rect x="37" y="64.72" width="11" height="11" fill="rgb(255, 255, 255)"
stroke="rgb(0, 0, 0)" pointer-events="none" />
<path d="M 59 70.55 L 48.01 70.6" fill="none" stroke="#cb81da" stroke-width="2"
stroke-miterlimit="10" pointer-events="none" />
<rect x="37" y="64.72" width="11" height="11" fill="#000000" stroke="#000000"
pointer-events="none" />
<rect x="37" y="42" width="11" height="11" fill="#000000" stroke="#000000"
pointer-events="none" />
<rect x="37" y="42" width="11" height="11" fill="#cb81da" stroke="#cb81da"
pointer-events="none" />
<rect x="37" y="64.72" width="11" height="11" fill="#cb81da" stroke="#cb81da"
pointer-events="none" />
<path d="M 48 48.14 L 53.51 48.09 L 53.51 61.31 L 59 61.34" fill="none" stroke="#cb81da"
stroke-width="2" stroke-miterlimit="10" pointer-events="none" />
<ellipse cx="17" cy="17" rx="7.500000000000001" ry="7.500000000000001" fill="#cb81da"
stroke="#cb81da" stroke-width="2" pointer-events="none" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,99 @@
@font-face {
font-family: "iconfont"; /* Project id 4748764 */
src: url('iconfont.woff2?t=1739366063009') format('woff2'),
url('iconfont.woff?t=1739366063009') format('woff'),
url('iconfont.ttf?t=1739366063009') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-markdown:before {
content: "\e946";
}
.icon-pdf:before {
content: "\e604";
}
.icon-html:before {
content: "\e6a0";
}
.icon-setting:before {
content: "\e657";
}
.icon-about:before {
content: "\e603";
}
.icon-i18n:before {
content: "\e669";
}
.icon-close:before {
content: "\e602";
}
.icon-full-screen:before {
content: "\e656";
}
.icon-down:before {
content: "\e69b";
}
.icon-download:before {
content: "\e66c";
}
.icon-export:before {
content: "\e63e";
}
.icon-scale-minus:before {
content: "\ec13";
}
.icon-scale-plus:before {
content: "\ec14";
}
.icon-triangle:before {
content: "\e615";
}
.icon-tree:before {
content: "\e601";
}
.icon-verilog:before {
content: "\e634";
}
.icon-top-module:before {
content: "\e682";
}
.icon-top:before {
content: "\e600";
}
.icon-parameter:before {
content: "\e655";
}
.icon-unknown:before {
content: "\e62a";
}
.icon-port:before {
content: "\e638";
}

Binary file not shown.

View File

@ -0,0 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="icon.png"><title>CodeDoc Viewer</title><link rel="stylesheet" href="default-dark.css"><link rel="stylesheet" href="vscode.css"><link rel="stylesheet" href="codedoc.css"><link rel="stylesheet" href="iconfont.css"><link rel="stylesheet" href="animation.css"><link rel="stylesheet" href="svg.css"><script defer="defer" src="js/chunk-vendors.bfc2ce54.js"></script><script defer="defer" src="js/app.c552ae0e.js"></script><link href="css/chunk-vendors.0be1d56f.css" rel="stylesheet"><link href="css/app.6bbe8d76.css" rel="stylesheet"></head><body><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,59 @@
/* .node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: rgba(203, 129, 208, 0.1) !important;
stroke: rgb(203, 129, 208) !important;
stroke-width: 1px !important;
} */
.node rect {
rx: 5 !important;
ry: 5 !important;
}
.info {
fill: var(--main-color) !important;
}
.common-svg-container,
.diagram-container {
display: flex;
justify-content: center;
position: relative;
margin-bottom: 10px;
border-radius: .3em;
transition: var(--animation-3s);
}
.container-inner {
display: flex;
justify-content: center;
min-height: 200px;
max-height: 880px;
width: 100%;
height: 100%;
padding: 30px 10px;
overflow: hidden;
}
.vscode-dark .common-svg-container,
.vscode-dark .diagram-container {
border: var(--dark-theme-border);
}
.vscode-dark .common-svg-container:hover,
.vscode-dark .diagram-container:hover {
border: 1px solid var(--main-color);
}
.vscode-light .common-svg-container,
.vscode-light .diagram-container {
border: var(--light-theme-border);
}
.vscode-light .common-svg-container:hover,
.vscode-light .diagram-container:hover {
border: 1px solid var(--main-color);
}

View File

@ -0,0 +1,149 @@
:root {
--font-monospace-family: var(--vscode-editor-font-family);
--font-monospace-weight: var(--vscode-editor-font-weight);
--font-monospace-size: var(--vscode-editor-font-size);
--link-foreground: var(--vscode-textLink-foreground);
--link-active: var(--vscode-textLink-activeForeground);
/* UI & Control */
--input-active-background: var(--vscode-input-background);
--input-active-border: var(--vscode-focusBorder);
--input-active-foreground: var(--vscode-input-foreground);
--input-error-background: var(--vscode-inputValidation-errorBackground);
--input-error-border: var(--vscode-inputValidation-errorBorder);
--input-error-foreground: var(--vscode-inputValidation-errorForeground);
--input-foreground: var(--vscode-input-foreground);
--input-background: var(--vscode-input-background);
--input-border: var(--vscode-input-border);
--input-hover: var(--vscode-input-background);
--input-placeholder: var(--vscode-input-placeholderForeground);
--input-radius: 0px;
--scrollbar-background: var(--vscode-scrollbarSlider-background);
--scrollbar-hover: var(--vscode-scrollbarSlider-hoverBackground);
--scrollbar-active: var(--vscode-scrollbarSlider-activeBackground);
/* Window */
--title-bar: #1f1f1f;
--title-color: #fff;
--foreground: var(--vscode-editor-foreground);
--background: var(--vscode-editor-background);
--label: rgb(189, 189, 189);
--shadow: #000;
--border: var(--vscode-input-border);
--window-button-hover: rgba(255,255,255,0.1);
--window-button-active: rgba(255,255,255,0.2);
--window-blur-background: rgba(0,0,0,0.25);
--window-title-foreground: var(--foreground);
--window-background: var(--sidebar);
--window-border: transparent;
--window-radius: 0px;
/* Sidebar */
--sidebar: var(--vscode-sideBar-background);
--sidebar-border: var(--vscode-sideBar-border);
--sidebar-min-width: 280px;
--sidebar-item-text: var(--vscode-list-inactiveSelectionForeground);
--sidebar-item-border: var(--vscode-input-border);
--sidebar-item-background: var(--sidebar);
--sidebar-item-selected: var(--vscode-list-inactiveSelectionBackground);
--sidebar-item-hover: var(--vscode-list-hoverBackground);
--sidebar-item-max-height: 40px;
--sidebar-item-radix-background: var(--vscode-breadcrumb-background);
--sidebar-group-text: var(--vscode-sideBarSectionHeader-foreground);
--sidebar-group-border: var(--vscode-sideBarSectionHeader-border);
--sidebar-group-background: var(--vscode-sideBarSectionHeader-background);
/* Labels */
--signalSize-background: rgba(0,0,0,0.5);
--signalSize-border: rgba(255,255,255,0.2);
--signalSize-color: var(--foreground);
/* Color Picker */
--picker-swatch-size: 15px;
--picker-swatch-cols: 8;
--picker-background: var(--vscode-breadcrumbPicker-background);
--picker-border: var(--vscode-dropdown-border);
/* Search */
--search-background: var(--vscode-quickInput-background);
--search-border: var(--border);
--search-panel-background: transparent;
--search-panel-border: var(--vscode-pickerGroup-border);
--search-panel-text: var(--vscode-quickInput-foreground);
--search-label: var(--foreground);
--search-selected-background: var(--vscode-list-inactiveSelectionBackground);
/* Properties */
--properties-background: var(--vscode-breadcrumb-background);
--properties-border: var(--border);
/* Navbar */
--navBar-background: var(--sidebar);
--navBar-height: 32px;
--navBar-button: transparent;
--navBar-button-text: var(--foreground);
--navBar-group-background: var(--background);
--navBar-preview-background: var(--vscode-scrollbarSlider-background);
--navBar-slider-border: var(--foreground);
/* Buttons */
--button: var(--vscode-button-background);
--button-text: var(--vscode-button-foreground);
--button-hover: var(--vscode-button-hoverBackground);
--button-active: var(--vscode-button-hoverBackground);
--button-disabled: var(--vscode-activityBar-background);
--button-disabled-text: var(--vscode-activityBar-inactiveForeground);
/* Grid Lines */
--grid-dash: 2;
--grid-space: 4;
--grid-line: var(--vscode-editorIndentGuide-background);
--grid-tick: var(--vscode-editorIndentGuide-activeBackground);
/* Cursor */
--cursor: var(--vscode-editorCursor-foreground);
--cursor-ghost: rgba(255, 255, 255, 0.2);
--cursor-width: 2;
/* X-Axis */
--axis-height: 38px;
--axis-line: var(--border);
--axis-background: var(--vscode-sideBar-background);
--axis-foreground: var(--foreground);
/* Signals */
--signal-highlight: var(--vscode-list-inactiveSelectionBackground);
/* Colors */
--accent: var(--vscode-button-background);
--accent-dim: #234175;
--accent-bright: #24c5f7;
--accent-hover: var(--vscode-button-hoverBackground);
--color-red: #ff5252;
--color-pink: #ff4081;
--color-purple: #e040fb;
--color-deepPurple: #7c4dff;
--color-indigo: #536dfe;
--color-blue: #448aff;
--color-lightBlue: #40c4ff;
--color-cyan: #18ffff;
--color-teal: #64ffda;
--color-green: #69f0ae;
--color-lightGreen: #b2ff59;
--color-lime: #eeff41;
--color-yellow: #ffff00;
--color-amber: #ffd740;
--color-orange: #ffab40;
--color-deepOrange: #ff6e40;
/* Settings */
--settings-action-background: var(--background);
}

View File

@ -64,7 +64,7 @@ def modify_vsix():
os.remove(dist_path)
# move public
# copy_dir('./resources/public', os.path.join(extract_folder, 'extension', 'resources', 'public'))
copy_dir('./out-js/function/dide-netlist', os.path.join(extract_folder, 'extension', 'out', 'function', 'dide-netlist'))
# webview
copy_dir('./resources/dide-netlist/view', os.path.join(extract_folder, 'extension', 'resources', 'dide-netlist', 'view'))
@ -95,7 +95,7 @@ def install_extension():
os.system('code --install-extension ' + vsix_path)
pipe = CommandPipe()
pipe.add_command('uninstall original extension', 'code --uninstall-extension sterben.fpga-support')
# pipe.add_command('uninstall original extension', 'code --uninstall-extension sterben.fpga-support')
pipe.add_command('compile typescript', 'tsc -p ./ --outDir out-js')
pipe.add_command('webpack', 'webpack --mode production')
pipe.add_command('make vsix installer', 'vsce package')

View File

@ -107,6 +107,6 @@ pipe.add_command('make vsix installer', 'vsce package')
pipe.add_command('modify vsix installer', lambda : modify_vsix())
# pipe.add_command('remove out-js', lambda : remove_folder('out-js'))
# pipe.add_command('remove out', lambda : remove_folder('out'))
pipe.add_command('install', lambda : install_extension())
# pipe.add_command('install', lambda : install_extension())
pipe.run()

View File

@ -0,0 +1,308 @@
import * as fs from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
import * as puppeteer from 'puppeteer-core';
import { PDFOptions, PaperFormat } from 'puppeteer-core';
import * as pako from 'pako';
import { t } from '../../i18n';
import { hdlPath } from '../../hdlFs';
import { opeParam } from '../../global';
export interface IPdfSetting {
scale: number
printBackground: boolean
landscape: boolean
format: string
}
async function htmlFile2PdfFile(htmlPath: string, pdfPath: string, option?: IPdfSetting) {
const browserPath = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe';
option = option || { scale: 1, printBackground: true, landscape: false, format: 'a4' };
const browser = await puppeteer.launch({
headless: 'new',
executablePath: browserPath,
args: ['--lang=en', '--no-sandbox', '--disable-setuid-sandbox']
});
const page = await browser.newPage();
const absoluteHtmlPath = path.resolve(htmlPath);
const uriFilePath = `file://${absoluteHtmlPath.replace(/\\/g, '/')}`;
await page.goto(uriFilePath, { waitUntil: 'networkidle0' });
const options: PDFOptions = {
path: pdfPath,
displayHeaderFooter: true,
// headerTemplate: '',
// footerTemplate: `<div style="font-size: 15px; margin: 0 auto; color: #CB81DA">CodeDoc - Powered By Digital IDE</div>`,
scale: option.scale,
printBackground: option.printBackground,
landscape: option.landscape,
format: option.format as PaperFormat,
margin: {
top: 0,
right: 0,
bottom: 0,
left: 0
}
};
await page.pdf(options);
await browser.close();
}
export async function getDocIR(data: any, panel: vscode.WebviewPanel, codeDocIr: any) {
const docIrPath = './static/codedoc.test.json';
const raw = fs.readFileSync(docIrPath, { encoding: 'utf-8' });
panel.webview.postMessage({
command: 'get-doc-ir',
codeDocIr
});
}
function makeHtmlFromTemplate(content: string, backgroundColor: string): string {
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital IDE</title>
</head>
<body>
<div class="dide-svg">
${content}
</div>
</body>
<style>
.dide-svg {
background-color: ${backgroundColor};
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</html>
`.trim();
}
export async function downloadSvg(data: any, panel: vscode.WebviewPanel) {
try {
const { svgString, format, backgroundColor } = data;
switch (format) {
case 'pdf':
await downloadAsPdf(svgString, backgroundColor);
break;
case 'svg':
await downloadAsSvg(svgString);
break;
case 'markdown':
await downloadAsMarkdown(svgString);
break;
default:
break;
}
} catch (error) {
console.log('发生错误 downloadSvg');
console.error(error);
}
}
async function downloadAsPdf(svgString: string, backgroundColor: string) {
const defaultFilename = '.pdf';
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
const saveUri = await vscode.window.showSaveDialog({
title: t('toolbar.save-as-pdf'),
defaultUri: vscode.Uri.file(defaultPath),
saveLabel: t('info.vcd-viewer.save'),
filters: {
[t('pdf-file')]: ['pdf'],
[t("info.vcd-viewer.all-file")]: ['*']
}
});
if (saveUri) {
const savePath = saveUri.fsPath;
const html = makeHtmlFromTemplate(svgString, backgroundColor);
fs.writeFileSync(savePath + '.html', html);
await htmlFile2PdfFile(savePath + '.html', savePath);
}
}
async function downloadAsSvg(svgString: string) {
const defaultFilename = '.svg';
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
const saveUri = await vscode.window.showSaveDialog({
title: t('netlist.save-as-svg'),
defaultUri: vscode.Uri.file(defaultPath),
saveLabel: t('info.vcd-viewer.save'),
filters: {
[t('svg-file')]: ['svg'],
[t("info.vcd-viewer.all-file")]: ['*']
}
});
if (saveUri) {
const savePath = saveUri.fsPath;
fs.writeFileSync(savePath, svgString);
}
}
async function downloadAsMarkdown(svgString: string) {
const defaultFilename = '.md';
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
const saveUri = await vscode.window.showSaveDialog({
title: t('netlist.save-as-markdown'),
defaultUri: vscode.Uri.file(defaultPath),
saveLabel: t('info.vcd-viewer.save'),
filters: {
[t('markdown-file')]: ['md'],
[t("info.vcd-viewer.all-file")]: ['*']
}
});
if (saveUri) {
const savePath = saveUri.fsPath;
fs.writeFileSync(savePath, svgString);
}
}
function makeDocHtmlFromTemplate(content: string, cssString: string): string {
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital IDE</title>
</head>
<body>
<div class="vscode-dark dide-doc">
${content}
</div>
</body>
<style>
.dide-doc {
width: 100vw;
height: 100vh;
}
${cssString}
</style>
</html>
`.trim();
}
function getNameFromFileName(filename: string) {
if (filename) {
if (filename.includes('/')) {
return filename.split('/').at(-1) || '';
}
return filename;
}
return '';
}
export async function exportDocHtml(data: any, panel: vscode.WebviewPanel) {
try {
const { renderStringArray, cssStringArray, filename, option } = data;
const renderString = pako.ungzip(renderStringArray, { to: 'string' });
const cssString = pako.ungzip(cssStringArray, { to: 'string' });
const html = makeDocHtmlFromTemplate(renderString, cssString);
const defaultFilename = getNameFromFileName(filename) + '.html';
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
const saveUri = await vscode.window.showSaveDialog({
title: t('toolbar.save-as-html'),
defaultUri: vscode.Uri.file(defaultPath),
saveLabel: t('info.vcd-viewer.save'),
filters: {
[t('html-file')]: ['html'],
[t("info.vcd-viewer.all-file")]: ['*']
}
});
if (saveUri) {
const savePath = saveUri.fsPath;
fs.writeFileSync(savePath, html);
}
} catch (error) {
console.error(error);
}
}
export async function exportDocPdf(data: any, panel: vscode.WebviewPanel) {
try {
const { renderStringArray, cssStringArray, filename, option } = data;
const renderString = pako.ungzip(renderStringArray, { to: 'string' });
const cssString = pako.ungzip(cssStringArray, { to: 'string' });
const html = makeDocHtmlFromTemplate(renderString, cssString);
const defaultFilename = getNameFromFileName(filename) + '.pdf';
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
const saveUri = await vscode.window.showSaveDialog({
title: t('toolbar.save-as-pdf'),
defaultUri: vscode.Uri.file(defaultPath),
saveLabel: t('info.vcd-viewer.save'),
filters: {
[t('pdf-file')]: ['pdf'],
[t("info.vcd-viewer.all-file")]: ['*']
}
});
if (saveUri) {
const savePath = saveUri.fsPath;
const tempPath = savePath + '.html';
fs.writeFileSync(tempPath, html);
console.log(option);
htmlFile2PdfFile(tempPath, savePath, option);
}
} catch (error) {
console.error(error);
}
}
export async function exportDocMarkdown(data: any, panel: vscode.WebviewPanel) {
try {
const { renderStringArray, cssStringArray, filename, option } = data;
const renderString = pako.ungzip(renderStringArray, { to: 'string' });
const cssString = pako.ungzip(cssStringArray, { to: 'string' });
console.log('receive renderString size: ' + renderString.length);
const html = makeDocHtmlFromTemplate(renderString, cssString);
const defaultFilename = getNameFromFileName(filename) + '.md';
const defaultPath = hdlPath.join(opeParam.workspacePath, defaultFilename);
const saveUri = await vscode.window.showSaveDialog({
title: t('netlist.save-as-markdown'),
defaultUri: vscode.Uri.file(defaultPath),
saveLabel: t('info.vcd-viewer.save'),
filters: {
[t('markdown-file')]: ['md'],
[t("info.vcd-viewer.all-file")]: ['*']
}
});
if (saveUri) {
const savePath = saveUri.fsPath;
const tempPath = savePath + '.html';
fs.writeFileSync(tempPath, html);
console.log(option);
htmlFile2PdfFile(tempPath, savePath, option);
}
} catch (error) {
console.error(error);
}
}

View File

@ -1,9 +1,13 @@
import * as vscode from 'vscode';
import * as fspath from 'path';
import { hdlIcon } from "../../hdlFs";
import { hdlFile, hdlIcon, hdlPath } from "../../hdlFs";
import { exportCurrentFileDocAsMarkdown, exportProjectDocAsMarkdown } from './markdown';
import { exportCurrentFileDocAsHTML, exportProjectDocAsHTML, showDocWebview, makeDocWebview } from './html';
import { exportCurrentFileDocAsHTML, exportProjectDocAsHTML, makeDocWebview } from './html';
import { exportCurrentFileDocAsPDF, exportProjectDocAsPDF } from './pdf';
import { downloadSvg, exportDocHtml, exportDocMarkdown, exportDocPdf, getDocIR } from './codedoc';
import { opeParam } from '../../global';
import { t } from '../../i18n';
const availableFormat = [
'markdown', 'pdf', 'html'
@ -32,7 +36,7 @@ export interface IDocManagerItem {
export const docManager = new Map<string, IDocManagerItem>();
function registerFileDocExport(context: vscode.ExtensionContext) {
export function registerFileDocExport(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('digital-ide.hdlDoc.exportFile', async uri => {
const option = {
placeHolder: 'Select an Export Format'
@ -55,7 +59,7 @@ function registerFileDocExport(context: vscode.ExtensionContext) {
});
}
function registerProjectDocExport(context: vscode.ExtensionContext) {
export function registerProjectDocExport(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('digital-ide.hdlDoc.exportProject', async () => {
const option = {
placeHolder: 'Select an Export Format'
@ -73,9 +77,68 @@ function registerProjectDocExport(context: vscode.ExtensionContext) {
});
}
export {
registerFileDocExport,
registerProjectDocExport,
showDocWebview,
makeDocWebview
};
function getWebviewContent(panel: vscode.WebviewPanel) {
const netlistPath = hdlPath.join(opeParam.extensionPath, 'resources', 'dide-doc', 'view');
const htmlIndexPath = hdlPath.join(netlistPath, 'index.html');
const html = hdlFile.readFile(htmlIndexPath)?.replace(/(<link.+?href="|<script.+?src="|<img.+?src=")(.+?)"/g, (m, $1, $2) => {
const absLocalPath = fspath.resolve(netlistPath, $2);
const webviewUri = panel.webview.asWebviewUri(vscode.Uri.file(absLocalPath));
const replaceHref = $1 + webviewUri?.toString() + '"';
return replaceHref;
});
return html;
}
export async function showDocWebview(uri: vscode.Uri) {
const panel = vscode.window.createWebviewPanel(
'CodeDoc',
'CodeDoc',
vscode.ViewColumn.Two,
{
enableScripts: true,
enableForms: true,
retainContextWhenHidden: true
}
);
panel.iconPath = hdlIcon.getIconConfig('documentation');
panel.onDidDispose(() => {});
const html = getWebviewContent(panel);
if (html) {
panel.webview.html = html;
registerMessageEvent(panel);
} else {
vscode.window.showErrorMessage(t('dide-doc.error.loading-html'));
}
}
function registerMessageEvent(panel: vscode.WebviewPanel) {
panel.webview.onDidReceiveMessage(message => {
const { command, data } = message;
// TODO: finish this
const codeDocIr = {};
switch (command) {
case 'get-doc-ir':
getDocIR(data, panel, codeDocIr);
break;
case 'download-svg':
downloadSvg(data, panel);
case 'export-doc-html':
exportDocHtml(data, panel);
break;
case 'export-doc-pdf':
exportDocPdf(data, panel);
break;
case 'export-doc-markdown':
exportDocMarkdown(data, panel);
break;
default:
break;
}
});
}

View File

@ -120,10 +120,6 @@ async function generateFilelist(path: AbsPath): Promise<AbsPath[]> {
pathset.add(path);
const filelist = [...pathset.files];
console.log(filelist);
console.log(opeParam.prjInfo.prjPath);
return filelist;
}

View File

@ -2,13 +2,13 @@ import * as vscode from 'vscode';
import * as path from 'path';
import * as hdlDoc from './dide-doc';
import { makeDocWebview } from './dide-doc/html';
import * as sim from './sim';
import * as treeView from './treeView';
import { tclCompletionProvider } from './lsp/completion/tcl';
import * as lspFormatter from '../../resources/formatter';
import * as lspTranslator from '../../resources/translator';
import * as tool from './tool';
// special function
@ -27,7 +27,7 @@ function registerDocumentation(context: vscode.ExtensionContext) {
// 展示 webview
item.panel.reveal(vscode.ViewColumn.Two);
} else {
const panel = await hdlDoc.makeDocWebview(uri, context);
const panel = await makeDocWebview(uri, context);
// TODO: 注册文件变动监听
const fileChangeDisposer = vscode.window.onDidChangeActiveTextEditor(async event => {
// const client = LspClient.DigitalIDE;
@ -46,7 +46,7 @@ function registerDocumentation(context: vscode.ExtensionContext) {
// }
});
hdlDoc.docManager.set(standardPath, { panel, fileChangeDisposer });
panel.onDidDispose(event => {
panel.onDidDispose(() => {
hdlDoc.docManager.delete(standardPath);
fileChangeDisposer.dispose();
});

View File

@ -51,8 +51,9 @@ function measureRequestTimecost(url: string, timeout: number = 5): Promise<numbe
export async function chooseBestDownloadSource(signature: string, version: string, timeout: number = 3000) {
const links = [
getGithubDownloadLink(signature, version),
getGiteeDownloadLink(signature, version)
// TODO: lsp update
getGithubDownloadLink(signature, '0.4.0'),
getGiteeDownloadLink(signature, '0.4.0')
];
const pools: Promise<number>[] = [];
for (const link of links) {

View File

@ -271,8 +271,6 @@ export async function publishDiagnostics(
path: string
) {
// 找到所有的库前缀,进行诊断(用于 verilator
// const searchPaths = getLibrarySearchPaths(path);
await client.sendRequest("workspace/executeCommand", {
command: 'publish-diagnostics',
arguments: [path]

View File

@ -13,6 +13,7 @@ import { ModuleDataItem } from '../treeView/tree';
import { defaultMacro, doFastApi } from '../../hdlParser/util';
import { t } from '../../i18n';
import { openWaveViewer } from '../dide-viewer';
import { HdlDependence } from '../../hdlParser/common';
type Path = string;
@ -68,7 +69,7 @@ class Simulate {
rst : '', // 设置的复位信号
end : '', //
wave : '', // wave存放的路径
simulationHome : '', // sim运行的路径
simulationHome : '', // sim运行的路径
gtkwavePath : '', // gtkwave安装路径
installPath : '', // 第三方仿真工具的安装路径
iverilogPath: 'iverilog', // iverilog仿真器所在路径
@ -100,7 +101,6 @@ class Simulate {
simConfig.simulationHome = defaultSimulationDir;
}
if (!hdlFile.isDir(simConfig.simulationHome)) {
MainOutput.report('create dir ' + simConfig.simulationHome, {
level: ReportType.Info
@ -239,7 +239,7 @@ export class IcarusSimulate extends Simulate {
* @description iverilog 仿
* @returns
*/
private getCommand(name: string, path: AbsPath, dependences: string[]): string | undefined {
private getCommand(name: string, path: AbsPath, dependences?: HdlDependence): string | undefined {
MainOutput.clear();
const simConfig = this.getConfig(path, 'iverilog');
@ -263,7 +263,17 @@ export class IcarusSimulate extends Simulate {
const simLibPaths = this.getSimLibArr(this.toolChain);
const macroIncludeArgs = this.makeMacroIncludeArguments(iverilogCompileOptions.includes);
const dependenceArgs = this.makeDependenceArguments(dependences);
let otherdeps: string[] = [];
let alldeps: string[] = [];
if (dependences) {
otherdeps = dependences.others;
alldeps = dependences.include;
}
else {
otherdeps = [];
alldeps = [];
}
const dependenceArgs = this.makeDependenceArguments(otherdeps);
const thirdLibraryArgs = this.makeThirdLibraryArguments(simLibPaths);
const thirdLibraryFileArgs = thirdLibraryArgs.fileArgsString;
@ -297,14 +307,23 @@ export class IcarusSimulate extends Simulate {
}
const extaArgs = args.join(' ');
let command = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name}`;
let command = `${iverilogPath} ${argu}`;
// const parent = fspath.dirname(path);
if (alldeps.length) {
command += ' ' + '-I';
for (let index = 0; index < alldeps.length; index++) {
const element = alldeps[index];
command += ' ' + '"' + hdlPath.resolve(element, '..') + '"';
}
}
command += ' ' + `-o ${outVvpPath} -s ${name}`;
if (extaArgs) {
command += ' ' + extaArgs;
}
// const parent = fspath.dirname(path);
// command += ' ' + '-I "' + parent + '"';
return command;
}
@ -361,7 +380,7 @@ export class IcarusSimulate extends Simulate {
* @description iverilog xxx
*/
private runIverilog(simConfig: SimulateConfig, command: string, cwd: string, hdlModule: HdlModule) {
child_process.exec(command, (error, stdout, stderr) => {
child_process.exec(command, { cwd }, (error, stdout, stderr) => {
if (error) {
this.reportCommandError(command, stderr);
return;
@ -391,7 +410,7 @@ export class IcarusSimulate extends Simulate {
}
/**
* @description vvp xxx
* @description vvp xxx
*/
private runVvp(command: string, cwd: string) {
child_process.exec(command, { cwd }, (error, stdout, stderr) => {
@ -496,11 +515,10 @@ export class IcarusSimulate extends Simulate {
// MainOutput.report(warningMsg, ReportType.Warn, true);
// return;
// }
const dependences = this.getAllOtherDependences(path, name);
const dependences = hdlParam.getAllDependences(path, name);
const simulationCommand = this.getCommand(name, path, dependences);
if (simulationCommand) {
const cwd = hdlPath.resolve(path, '..');
const cwd = hdlPath.resolve(path, '..');
this.exec(simulationCommand, cwd, hdlModule);
} else {
const errorMsg = 'Fail to generate command';

View File

@ -587,7 +587,7 @@ class PrjInfo implements PrjInfoMeta {
}
public get libCustomPath(): AbsPath {
const libPath = vscode.workspace.getConfiguration().get('digital-ide.lib.custom.path', this._workspacePath);
const libPath = join(vscode.workspace.getConfiguration().get('digital-ide.lib.custom.path', this._workspacePath));
if (!fs.existsSync(libPath)) {
return '';
}

View File

@ -97,7 +97,6 @@ export class WebviewCollection {
}
}
export function replacePlaceholders(template: string, ...args: string[]): string {
return template.replace(/\$(\d+)/g, (match, p1) => {
const index = parseInt(p1, 10) - 1;

View File

@ -312,6 +312,8 @@ class HdlParam {
return common.HdlFileProjectType.LocalLib;
} else if (path.startsWith(prjInfo.remoteLibPath)) {
return common.HdlFileProjectType.RemoteLib;
} else if (path.startsWith(prjInfo.libCustomPath)) {
return common.HdlFileProjectType.RemoteLib;
} else {
return common.HdlFileProjectType.Unknown;
}

View File

@ -1,9 +1,109 @@
import * as vscode from 'vscode';
import { ChildProcessWithoutNullStreams, exec, spawn } from 'child_process';
import * as fspath from 'path';
import * as fs from 'fs';
import { AbsPath, opeParam, PrjInfo } from '../../global';
import { hdlParam } from '../../hdlParser/core';
import { hdlFile, hdlDir, hdlPath } from '../../hdlFs';
import { PropertySchema } from '../../global/propertySchema';
import { XilinxIP } from '../../global/enum';
import { HardwareOutput, MainOutput, ReportType } from '../../global/outputChannel';
import { debounce, getPIDsWithName, killProcess } from '../../global/util';
import { t } from '../../i18n';
import { HdlFileProjectType } from '../../hdlParser/common';
import { parseString, Builder, processors } from 'xml2js';
const syn = ` <efx:synthesis tool_name="efx_map">
<efx:param name="work_dir" value="work_syn" value_type="e_string"/>
<efx:param name="write_efx_verilog" value="on" value_type="e_bool"/>
<efx:param name="mode" value="speed" value_type="e_option"/>
<efx:param name="max_ram" value="-1" value_type="e_integer"/>
<efx:param name="max_mult" value="-1" value_type="e_integer"/>
<efx:param name="infer-clk-enable" value="3" value_type="e_option"/>
<efx:param name="infer-sync-set-reset" value="1" value_type="e_option"/>
<efx:param name="min-sr-fanout" value="0" value_type="e_integer"/>
<efx:param name="min-ce-fanout" value="0" value_type="e_integer"/>
<efx:param name="fanout-limit" value="0" value_type="e_integer"/>
<efx:param name="bram_output_regs_packing" value="1" value_type="e_option"/>
<efx:param name="retiming" value="1" value_type="e_option"/>
<efx:param name="seq_opt" value="1" value_type="e_option"/>
<efx:param name="blast_const_operand_adders" value="1" value_type="e_option"/>
<efx:param name="operator-sharing" value="0" value_type="e_option"/>
<efx:param name="optimize-adder-tree" value="0" value_type="e_option"/>
<efx:param name="seq-opt-sync-only" value="0" value_type="e_option"/>
<efx:param name="blackbox-error" value="1" value_type="e_option"/>
<efx:param name="allow-const-ram-index" value="0" value_type="e_option"/>
<efx:param name="hdl-compile-unit" value="1" value_type="e_option"/>
<efx:param name="create-onehot-fsms" value="0" value_type="e_option"/>
<efx:param name="dsp-mac-packing" value="1" value_type="e_option"/>
<efx:param name="dsp-output-regs-packing" value="1" value_type="e_option"/>
<efx:param name="dsp-input-regs-packing" value="1" value_type="e_option"/>
<efx:param name="pack-luts-to-comb4" value="0" value_type="e_option"/>
<efx:param name="mult-auto-pipeline" value="0" value_type="e_option"/>
<efx:param name="mult-decomp-retime" value="0" value_type="e_option"/>
<efx:param name="optimize-zero-init-rom" value="1" value_type="e_option"/>
<efx:param name="use-logic-for-small-mem" value="64" value_type="e_integer"/>
<efx:param name="use-logic-for-small-rom" value="64" value_type="e_integer"/>
<efx:param name="insert-carry-skip" value="0" value_type="e_option"/>
</efx:synthesis>`;
const pnr = ` <efx:place_and_route tool_name="efx_pnr">
<efx:param name="work_dir" value="work_pnr" value_type="e_string"/>
<efx:param name="verbose" value="off" value_type="e_bool"/>
<efx:param name="load_delaym" value="on" value_type="e_bool"/>
<efx:param name="optimization_level" value="NULL" value_type="e_option"/>
<efx:param name="seed" value="1" value_type="e_integer"/>
<efx:param name="placer_effort_level" value="2" value_type="e_option"/>
<efx:param name="max_threads" value="-1" value_type="e_integer"/>
<efx:param name="print_critical_path" value="10" value_type="e_integer"/>
<efx:param name="beneficial_skew" value="on" value_type="e_option"/>
</efx:place_and_route>`;
const bit = ` <efx:bitstream_generation tool_name="efx_pgm">
<efx:param name="mode" value="active" value_type="e_option"/>
<efx:param name="width" value="1" value_type="e_option"/>
<efx:param name="enable_roms" value="smart" value_type="e_option"/>
<efx:param name="spi_low_power_mode" value="on" value_type="e_bool"/>
<efx:param name="io_weak_pullup" value="on" value_type="e_bool"/>
<efx:param name="oscillator_clock_divider" value="DIV8" value_type="e_option"/>
<efx:param name="bitstream_compression" value="on" value_type="e_bool"/>
<efx:param name="enable_external_master_clock" value="off" value_type="e_bool"/>
<efx:param name="active_capture_clk_edge" value="negedge" value_type="e_option"/>
<efx:param name="jtag_usercode" value="0xFFFFFFFF" value_type="e_string"/>
<efx:param name="release_tri_then_reset" value="on" value_type="e_bool"/>
<efx:param name="four_byte_addressing" value="off" value_type="e_bool"/>
<efx:param name="generate_bit" value="on" value_type="e_bool"/>
<efx:param name="generate_bitbin" value="off" value_type="e_bool"/>
<efx:param name="generate_hex" value="on" value_type="e_bool"/>
<efx:param name="generate_hexbin" value="off" value_type="e_bool"/>
<efx:param name="cold_boot" value="off" value_type="e_bool"/>
<efx:param name="cascade" value="off" value_type="e_option"/>
</efx:bitstream_generation>`;
const debug = ` <efx:debugger>
<efx:param name="work_dir" value="work_dbg" value_type="e_string"/>
<efx:param name="auto_instantiation" value="off" value_type="e_bool"/>
<efx:param name="profile" value="NONE" value_type="e_string"/>
</efx:debugger>`;
const security = ` <efx:security>
<efx:param name="randomize_iv_value" value="on" value_type="e_bool"/>
<efx:param name="iv_value" value="" value_type="e_string"/>
<efx:param name="enable_bitstream_encrypt" value="off" value_type="e_bool"/>
<efx:param name="enable_bitstream_auth" value="off" value_type="e_bool"/>
<efx:param name="encryption_key_file" value="NONE" value_type="e_string"/>
<efx:param name="auth_key_file" value="NONE" value_type="e_string"/>
</efx:security>`;
export async function generateEfinityConfig() {
}
export class EfinityOperation {
// config: Record<string, any>;
constructor() {
}
}

View File

@ -75,7 +75,7 @@ class XilinxOperation {
}
public get xbdPath(): AbsPath {
return hdlPath.join(opeParam.extensionPath, 'lib', 'xilinx', 'bd');
return hdlPath.join(opeParam.extensionPath, 'library', 'Factory', 'xilinx', 'bd');
}
public get xilinxPath(): AbsPath {
@ -121,7 +121,6 @@ class XilinxOperation {
};
}
public get topMod(): TopMod {
return {
src : opeParam.firstSrcTopModule.name,
@ -137,7 +136,6 @@ class XilinxOperation {
};
}
/**
* xilinx下的launch运行
* @param context
@ -355,19 +353,7 @@ class XilinxOperation {
vscode.window.showErrorMessage(`cp ${bd} failed, can not find ${bdSrcPath}`);
}
}
const bdPaths = [
hdlPath.join(this.HWPath, 'bd'),
hdlPath.join(this.prjInfo.path, this.prjInfo.name + '.src', 'sources_1', 'bd')
];
hdlFile.pickFileRecursive(bdPaths, filePath => {
if (filePath.endsWith('.bd')) {
scripts.push(`add_files ${filePath} -quiet`);
scripts.push(`add_files ${fspath.dirname(filePath)}/hdl -quiet`);
}
});
if (bd) {
const loadBdPath = hdlPath.join(this.HWPath, 'bd', bd, bdFile);
scripts.push(`generate_target all [get_files ${loadBdPath}] -quiet`);
@ -375,6 +361,18 @@ class XilinxOperation {
scripts.push(`open_bd_design ${loadBdPath} -quiet`);
}
}
const bdPaths = [
hdlPath.join(this.HWPath, 'bd'),
hdlPath.join(this.prjInfo.path, this.prjInfo.name + '.src', 'sources_1', 'bd')
];
hdlFile.pickFileRecursive(bdPaths, filePath => {
if (filePath.endsWith('.bd')) {
scripts.push(`add_files ${filePath} -quiet`);
scripts.push(`add_files ${fspath.dirname(filePath)}/hdl -quiet`);
}
});
const mrefPath = hdlPath.join(this.HWPath, 'bd', 'mref');
hdlFile.pickFileRecursive(mrefPath, filePath => {
@ -396,6 +394,7 @@ class XilinxOperation {
});
// 导入非本地的设计源文件
console.log(hdlParam.getAllHdlFiles());
for (const hdlFile of hdlParam.getAllHdlFiles()) {
switch (hdlFile.projectType) {
case HdlFileProjectType.Src:

View File

@ -270,7 +270,6 @@ class PrjManage {
}
}
public async createFolderByDefault(rawPrjInfo: RawPrjInfo) {
// create prj first
const defaultPrjPath = hdlPath.join(opeParam.workspacePath, 'prj');

View File

@ -172,7 +172,11 @@
"keywords": {
"patterns": [
{
"match": "\\b(always|and|assign|attribute|begin|buf|bufif0|bufif1|case(xz)?|cmos|deassign|default|defparam|disable|edge|else|end(attribute|case|function|generate|module|primitive|specify|table|task)?|event|for|force|forever|fork|function|generate|genvar|highz(01)|if(none)?|initial|inout|input|output|integer|join|localparam|medium|module|large|macromodule|nand|negedge|nmos|nor|not|notif(01)|or|parameter|pmos|posedge|primitive|pull0|pull1|pulldown|pullup|rcmos|real|realtime|reg|release|repeat|rnmos|rpmos|rtran|rtranif(01)|scalared|signed|small|specify|specparam|strength|strong0|strong1|supply0|supply1|table|task|time|tran|tranif(01)|tri(01)?|tri(and|or|reg)|unsigned|vectored|wait|wand|weak(01)|while|wire|wor|xnor|xor|logic)\\b",
"match": "\\b(always|and|assign|attribute|begin|buf|bufif0|bufif1|case(xz)?|cmos|deassign|default|defparam|disable|edge|else|end(attribute|case|function|generate|module|primitive|specify|table|task)?|event|for|force|forever|fork|function|generate|genvar|highz(01)|if(none)?|initial|inout|input|output|logic|integer|join|localparam|medium|module|large|macromodule|nand|negedge|nmos|nor|not|notif(01)|or|parameter|pmos|posedge|primitive|pull0|pull1|pulldown|pullup|rcmos|real|realtime|reg|release|repeat|rnmos|rpmos|rtran|rtranif(01)|scalared|signed|small|specify|specparam|strength|strong0|strong1|supply0|supply1|table|task|time|tran|tranif(01)|tri(01)?|tri(and|or|reg)|unsigned|vectored|wait|wand|weak(01)|while|wire|wor|xnor|xor)\\b",
"name": "keyword.other.verilog"
},
{
"match": "\\b(byte|program|config|incdir|instance|int|shortint|longint|bind|liblist|void|local|endconfig|package|library|const|virtual|automatic|constraint|include|var|covergroup|string|null|randc|class|extends|sequence|shortreal|interface|protected|rand)\\b",
"name": "keyword.other.verilog"
},
{