diff --git a/package.json b/package.json index 96353b6..afae3a6 100644 --- a/package.json +++ b/package.json @@ -956,7 +956,6 @@ "typescript": "^4.8.4" }, "dependencies": { - "@vscode/wasm-wasi": "^0.8.2", "chokidar": "^3.5.3", "puppeteer-core": "^19.4.1", "showdown": "^2.1.0", diff --git a/src/function/lsp/core/vlog.ts b/src/function/lsp/core/vlog.ts index bc94308..05a9fad 100644 --- a/src/function/lsp/core/vlog.ts +++ b/src/function/lsp/core/vlog.ts @@ -15,6 +15,11 @@ class VlogSymbolStorage { public async getSymbol(path: AbsPath): ThenableAll { path = hdlPath.toSlash(path); + const allP = this.symbolMap.get(path); + if (allP) { + return await allP; + } + this.updateSymbol(path); const all = await this.symbolMap.get(path); return all; } diff --git a/src/function/lsp/hover/vlog.ts b/src/function/lsp/hover/vlog.ts index 62e0cc6..5c70fa8 100644 --- a/src/function/lsp/hover/vlog.ts +++ b/src/function/lsp/hover/vlog.ts @@ -27,7 +27,7 @@ class VlogHoverProvider implements vscode.HoverProvider { } const filePath = document.fileName; - const vlogAll = await vlogSymbolStorage.getSymbol(filePath); + const vlogAll = await vlogSymbolStorage.getSymbol(filePath); if (!vlogAll) { return null; } else { diff --git a/src/function/sim/simulate.ts b/src/function/sim/simulate.ts index 649f488..2b2611f 100644 --- a/src/function/sim/simulate.ts +++ b/src/function/sim/simulate.ts @@ -166,16 +166,17 @@ class IcarusSimulate extends Simulate { return args.join(' ').trim(); } - private makeThirdLibraryArguments(simLibPaths: string[]): string { - const args = []; + private makeThirdLibraryArguments(simLibPaths: string[]): { fileArgs: string[], dirArgs: string[] } { + const fileArgs = []; + const dirArgs = []; for (const libPath of simLibPaths) { if(!hdlFile.isDir(libPath)) { - args.push(libPath); + fileArgs.push(libPath); } else { - args.push('-y ' + libPath); + dirArgs.push('-y ' + libPath); } } - return args.join(' ').trim(); + return { fileArgs, dirArgs }; } /** @@ -210,13 +211,16 @@ class IcarusSimulate extends Simulate { const dependenceArgs = this.makeDependenceArguments(dependences); const thirdLibraryArgs = this.makeThirdLibraryArguments(simLibPaths); + const thirdLibraryFileArgs = thirdLibraryArgs.fileArgs; + const thirdLibraryDirArgs = thirdLibraryArgs.dirArgs; + const iverilogPath = simConfig.iverilogPath; // default is -g2012 const argu = '-g' + iverilogCompileOptions.standard; const outVvpPath = '"' + hdlPath.join(simConfig.simulationHome, 'out.vvp') + '"'; const mainPath = '"' + path + '"'; - const cmd = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name} ${macroIncludeArgs} ${thirdLibraryArgs} ${mainPath} ${dependenceArgs}`; + const cmd = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name} ${macroIncludeArgs} ${thirdLibraryDirArgs} ${mainPath} ${dependenceArgs} ${thirdLibraryFileArgs}`; MainOutput.report(cmd, ReportType.Run); return cmd; } diff --git a/src/test/user/Hardware/src/Cordic.v b/src/test/user/Hardware/src/Cordic.v index a5a2fba..1285922 100644 --- a/src/test/user/Hardware/src/Cordic.v +++ b/src/test/user/Hardware/src/Cordic.v @@ -78,6 +78,8 @@ initial begin end end + + integer n; initial begin for (n = 0; n<=ITERATIONS; n=n+1) begin @@ -99,6 +101,9 @@ initial begin end end + + + genvar i; generate for(i=0;i