This commit is contained in:
锦恢 2025-01-06 23:01:02 +08:00
parent 4861410eab
commit 6834968bc5
2 changed files with 4 additions and 33 deletions

View File

@ -198,8 +198,7 @@
"xc7a35tftg256-1", "xc7a35tftg256-1",
"xc7a35tcsg324-1", "xc7a35tcsg324-1",
"xc7z035ffg676-2", "xc7z035ffg676-2",
"xc7z020clg484-1", "xc7z020clg484-1"
"hello-world"
] ]
} }
}, },

View File

@ -182,8 +182,10 @@ class Netlist {
basepreopens[realMount.toLowerCase()] = realMount; basepreopens[realMount.toLowerCase()] = realMount;
basepreopens[realMount.toUpperCase()] = realMount; basepreopens[realMount.toUpperCase()] = realMount;
} }
} else {
basepreopens['/'] = '/';
} }
return basepreopens return basepreopens;
} }
private async makeWasi(target: string, logName: string) { private async makeWasi(target: string, logName: string) {
@ -192,8 +194,6 @@ class Netlist {
hdlFile.removeFile(logFilePath); hdlFile.removeFile(logFilePath);
const logFd = fs.openSync(logFilePath, 'a'); const logFd = fs.openSync(logFilePath, 'a');
console.log(target);
try { try {
const wasiOption = { const wasiOption = {
version: 'preview1', version: 'preview1',
@ -288,34 +288,6 @@ class Netlist {
return html; return html;
} }
public async export(type: string, svg: string) {
switch (type) {
case "svg":
await this.exportSvg(svg);
break;
default: break;
}
}
public async exportSvg(svg: string) {
const filter = { 'svg': ['svg'] };
const fileInfos = await vscode.window.showSaveDialog({ filters: filter });
if (fileInfos && fileInfos.path) {
let savePath = fileInfos.path;
if (savePath[0] === '/' && require('os').platform() === 'win32') {
savePath = savePath.substring(1);
}
hdlFile.writeFile(savePath, svg);
vscode.window.showInformationMessage('Schematic saved in ' + savePath);
YosysOutput.report('Schematic saved in ' + savePath);
}
}
public getJsonPathFromYs(path: AbsPath): AbsPath | undefined { public getJsonPathFromYs(path: AbsPath): AbsPath | undefined {
for (const line of fs.readFileSync(path, { encoding: 'utf-8' }).split('\n')) { for (const line of fs.readFileSync(path, { encoding: 'utf-8' }).split('\n')) {
if (line.trim().startsWith('write_json')) { if (line.trim().startsWith('write_json')) {