#fix beta 0.3.0 Bitwidth of 1-bit signal is incorrectly recognized as Unknown in auto instantiation and auto document

This commit is contained in:
锦恢 2023-07-22 01:54:18 +08:00
parent 5136794741
commit d6c80a919a
4 changed files with 13 additions and 4 deletions

View File

@ -31,15 +31,20 @@ function makeTableFromObjArray(md: MarkdownString, array: any[], name: string, f
const rows = []; const rows = [];
for (const obj of array) { for (const obj of array) {
const data = []; const data = [];
for (const name of fieldNames) { for (const subName of fieldNames) {
let value = obj[name]; let value = obj[subName];
if (name === 'instModPath' && value) { if (subName === 'instModPath' && value) {
value = value.replace(ws, ''); value = value.replace(ws, '');
} }
if (value && value.trim().length === 0) { if (value && value.trim().length === 0) {
value = ' '; value = ' ';
} }
// TODO : 1 not known
if (name === 'ports' && value === 'Unknown') {
value = '1';
}
data.push(value); data.push(value);
} }
rows.push(data); rows.push(data);

View File

@ -86,6 +86,9 @@ function makeNetOutputDeclaration(ports: HdlModulePort[], prefix: string, needCo
if (port.type === HdlModulePortType.Output) { if (port.type === HdlModulePortType.Output) {
haveOutput = true; haveOutput = true;
let portWidth = port.width ? port.width : ''; let portWidth = port.width ? port.width : '';
if (portWidth === 'Unknown') {
portWidth = '';
}
portWidth += ' '.repeat(maxWidthLength - portWidth.length + 1); portWidth += ' '.repeat(maxWidthLength - portWidth.length + 1);
const netDeclaration = prefix + `wire ${portWidth}\t${port.name};\n`; const netDeclaration = prefix + `wire ${portWidth}\t${port.name};\n`;
netOutputDeclaration += netDeclaration; netOutputDeclaration += netDeclaration;

View File

@ -11,6 +11,7 @@ output reg carry_out, borrow_out, parity_out;
reg [9:0] cnt_up, cnt_dn; reg [9:0] cnt_up, cnt_dn;
reg [8:0] count_nxt; reg [8:0] count_nxt;
always @(posedge clock) always @(posedge clock)
begin begin
cnt_dn = count_out - 3'b 101; cnt_dn = count_out - 3'b 101;

View File

@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"target": "ES2020", "target": "ES2020",
"outDir": "out-js", "outDir": "out",
"skipLibCheck": true, "skipLibCheck": true,
"lib": [ "lib": [
"ES2020" "ES2020"