update
This commit is contained in:
parent
2bf0d54f9b
commit
138e43dc4d
41
script/command/pull-digital-lsp.py
Normal file
41
script/command/pull-digital-lsp.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import tarfile
|
||||||
|
import os
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--version', default='0.4.0')
|
||||||
|
args = parser.parse_args()
|
||||||
|
version_string = args.version
|
||||||
|
|
||||||
|
def compress_to_tar_gz(source_dir, output_filename):
|
||||||
|
with tarfile.open(output_filename, "w:gz") as tar:
|
||||||
|
if os.path.isdir(source_dir):
|
||||||
|
# 如果是目录,递归添加目录中的所有文件
|
||||||
|
for root, dirs, files in os.walk(source_dir):
|
||||||
|
for file in files:
|
||||||
|
file_path = os.path.join(root, file)
|
||||||
|
arcname = os.path.relpath(file_path, source_dir)
|
||||||
|
tar.add(file_path, arcname=arcname)
|
||||||
|
else:
|
||||||
|
# 如果是文件,直接添加文件
|
||||||
|
tar.add(source_dir, arcname=os.path.basename(source_dir))
|
||||||
|
|
||||||
|
os.system('scp -P 8024 dide@nc-ai.cn:/home/dide/project/digital-lsp-server/target/release/digital-lsp digital-lsp')
|
||||||
|
compress_to_tar_gz('digital-lsp', f'digital-lsp_{version_string}_linux_amd64.tar.gz')
|
||||||
|
|
||||||
|
os.system('scp -P 8024 dide@nc-ai.cn:/home/dide/project/digital-lsp-server/target/aarch64-unknown-linux-gnu/release/digital-lsp digital-lsp')
|
||||||
|
compress_to_tar_gz('digital-lsp', f'digital-lsp_{version_string}_linux_aarch64.tar.gz')
|
||||||
|
|
||||||
|
os.system('scp -P 8024 dide@nc-ai.cn:/home/dide/project/digital-lsp-server/target/x86_64-pc-windows-gnu/release/digital-lsp.exe digital-lsp.exe')
|
||||||
|
compress_to_tar_gz('digital-lsp.exe', f'digital-lsp_{version_string}_windows_amd64.tar.gz')
|
||||||
|
|
||||||
|
os.system('scp -P 8024 dide@nc-ai.cn:/home/dide/project/digital-lsp-server/target/aarch64-pc-windows-msvc/release/digital-lsp.exe digital-lsp.exe')
|
||||||
|
compress_to_tar_gz('digital-lsp.exe', f'digital-lsp_{version_string}_windows_aarch64.tar.gz')
|
||||||
|
|
||||||
|
os.system('scp -P 8024 dide@nc-ai.cn:/home/dide/project/digital-lsp-server/target/x86_64-apple-darwin/release/digital-lsp digital-lsp')
|
||||||
|
compress_to_tar_gz('digital-lsp', f'digital-lsp_{version_string}_darwin_amd64.tar.gz')
|
||||||
|
|
||||||
|
os.system('scp -P 8024 dide@nc-ai.cn:/home/dide/project/digital-lsp-server/target/aarch64-apple-darwin/release/digital-lsp digital-lsp')
|
||||||
|
compress_to_tar_gz('digital-lsp', f'digital-lsp_{version_string}_darwin_aarch64.tar.gz')
|
||||||
|
|
@ -14,7 +14,7 @@ import { platform } from "os";
|
|||||||
import { IProgress, LspClient } from '../../global';
|
import { IProgress, LspClient } from '../../global';
|
||||||
import axios, { AxiosResponse } from "axios";
|
import axios, { AxiosResponse } from "axios";
|
||||||
import { chooseBestDownloadSource, getGiteeDownloadLink, getGithubDownloadLink, getPlatformPlatformSignature } from "./cdn";
|
import { chooseBestDownloadSource, getGiteeDownloadLink, getGithubDownloadLink, getPlatformPlatformSignature } from "./cdn";
|
||||||
import { hdlDir } from "../../hdlFs";
|
import { hdlDir, hdlPath } from "../../hdlFs";
|
||||||
|
|
||||||
function getLspServerExecutionName() {
|
function getLspServerExecutionName() {
|
||||||
const osname = platform();
|
const osname = platform();
|
||||||
@ -39,7 +39,13 @@ function extractTarGz(filePath: string, outputDir: string): Promise<void> {
|
|||||||
inputStream.pipe(gunzip).pipe(extract);
|
inputStream.pipe(gunzip).pipe(extract);
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
extract.on('finish', resolve);
|
extract.on('finish', () => {
|
||||||
|
for (const file of fs.readdirSync(outputDir)) {
|
||||||
|
const filePath = hdlPath.join(outputDir, file);
|
||||||
|
fs.chmodSync(filePath, '755');
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
extract.on('error', reject);
|
extract.on('error', reject);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -105,6 +111,8 @@ export async function downloadLsp(context: vscode.ExtensionContext, version: str
|
|||||||
|
|
||||||
const signature = getPlatformPlatformSignature().toString();
|
const signature = getPlatformPlatformSignature().toString();
|
||||||
const downloadLink = await chooseBestDownloadSource(signature, version, timeout);
|
const downloadLink = await chooseBestDownloadSource(signature, version, timeout);
|
||||||
|
console.log('choose download link: ' + downloadLink);
|
||||||
|
|
||||||
clearInterval(intervalHandler);
|
clearInterval(intervalHandler);
|
||||||
return downloadLink
|
return downloadLink
|
||||||
});
|
});
|
||||||
|
@ -244,6 +244,11 @@ class IcarusSimulate extends Simulate {
|
|||||||
const outVvpPath = makeSafeArgPath(hdlPath.join(simConfig.simulationHome, 'out.vvp'));
|
const outVvpPath = makeSafeArgPath(hdlPath.join(simConfig.simulationHome, 'out.vvp'));
|
||||||
const mainPath = makeSafeArgPath(path);
|
const mainPath = makeSafeArgPath(path);
|
||||||
|
|
||||||
|
// console.log(macroIncludeArgs);
|
||||||
|
// console.log(thirdLibraryDirArgs);
|
||||||
|
// console.log(dependenceArgs);
|
||||||
|
// console.log(thirdLibraryFileArgs);
|
||||||
|
|
||||||
const cmd = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name} ${macroIncludeArgs} ${thirdLibraryDirArgs} ${mainPath} ${dependenceArgs} ${thirdLibraryFileArgs}`;
|
const cmd = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name} ${macroIncludeArgs} ${thirdLibraryDirArgs} ${mainPath} ${dependenceArgs} ${thirdLibraryFileArgs}`;
|
||||||
MainOutput.report(cmd, ReportType.Run);
|
MainOutput.report(cmd, ReportType.Run);
|
||||||
return cmd;
|
return cmd;
|
||||||
|
@ -643,6 +643,11 @@ class HdlModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 计算出当前 instance 和父组件的 包含关系
|
||||||
|
* @param instModName instance 的名字
|
||||||
|
* @returns InstModPathSearchResult
|
||||||
|
*/
|
||||||
private searchInstModPath(instModName: string): common.InstModPathSearchResult {
|
private searchInstModPath(instModName: string): common.InstModPathSearchResult {
|
||||||
// search path of instance
|
// search path of instance
|
||||||
// priority: "current file" -> "included files" -> "other hdls in the project"
|
// priority: "current file" -> "included files" -> "other hdls in the project"
|
||||||
@ -661,7 +666,10 @@ class HdlModule {
|
|||||||
// search included file
|
// search included file
|
||||||
for (const include of this.file.macro.includes) {
|
for (const include of this.file.macro.includes) {
|
||||||
const absIncludePath = hdlPath.rel2abs(this.path, include.path);
|
const absIncludePath = hdlPath.rel2abs(this.path, include.path);
|
||||||
|
console.log(absIncludePath);
|
||||||
const includeFile = hdlParam.getHdlFile(absIncludePath);
|
const includeFile = hdlParam.getHdlFile(absIncludePath);
|
||||||
|
console.log(includeFile);
|
||||||
|
|
||||||
if (includeFile) {
|
if (includeFile) {
|
||||||
excludeFile.add(includeFile);
|
excludeFile.add(includeFile);
|
||||||
if (includeFile.hasHdlModule(instModName)) {
|
if (includeFile.hasHdlModule(instModName)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user