From 3ff3789bf8c439a341c001ef3b1d84a58e7f4131 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Tue, 9 Oct 2018 21:49:29 -0400 Subject: [PATCH] minor scope tweaks, need phantomjs for wavedrom --- doc/notes.txt | 2 +- package.json | 1 + presets/verilog/starfield.v | 3 ++- src/platform/verilog.ts | 1 + src/waveform.ts | 7 ++++--- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/notes.txt b/doc/notes.txt index 733cd58c..bce89dbe 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -70,10 +70,10 @@ TODO: - fix WebAudio (https://news.ycombinator.com/item?id=18066474) - Safari: verilog scope doesn't work - share playable link w/ verilog? -- no errors for verilog inline asm? - allow download of JSASM output - update bootstrap/jquery - clean BOM from verilog +- $readmemb/h WEB WORKER FORMAT diff --git a/package.json b/package.json index dc0169f2..a8577f12 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "jsdom": "^12.0.0", "lzg": "^1.0.0", "mocha": "^5.2.0", + "phantomjs": "^2.1.7", "typescript": "^3.0.1", "wavedrom-cli": "^0.5.0" }, diff --git a/presets/verilog/starfield.v b/presets/verilog/starfield.v index d0ab4f30..aa42faa0 100644 --- a/presets/verilog/starfield.v +++ b/presets/verilog/starfield.v @@ -26,6 +26,7 @@ module starfield_top(clk, reset, hsync, vsync, rgb); .vpos(vpos) ); + // enable LFSR only in 256x256 area wire star_enable = !hpos[8] & !vpos[8]; // LFSR with period = 2^16-1 = 256*256-1 @@ -35,7 +36,7 @@ module starfield_top(clk, reset, hsync, vsync, rgb); .enable(star_enable), .lfsr(lfsr)); - wire star_on = &lfsr[15:9]; + wire star_on = &lfsr[15:9]; // all 7 bits must be set assign rgb = display_on && star_on ? lfsr[2:0] : 0; endmodule diff --git a/src/platform/verilog.ts b/src/platform/verilog.ts index f5f59e96..16f17bad 100644 --- a/src/platform/verilog.ts +++ b/src/platform/verilog.ts @@ -671,6 +671,7 @@ var VerilogPlatform = function(mainElement, options) { if (trace_buffer) trace_buffer.fill(0); if (video) video.setRotate(gen.rotate ? -90 : 0); $("#verilog_bar").hide(); + if (!this.hasvideo) this.resume(); // TODO? } tick() { gen.tick2(); diff --git a/src/waveform.ts b/src/waveform.ts index 20c9dc26..1d074100 100644 --- a/src/waveform.ts +++ b/src/waveform.ts @@ -197,10 +197,11 @@ export class WaveformView { var x = 0; var y = 0; var lastval = -1; + var radix = this.hexformat ? 16 : 10; for (var i=0; i0) @@ -229,7 +230,7 @@ export class WaveformView { var val = data[this.tsel - this.t0]; ctx.textAlign = 'right'; if (val !== undefined) { - var s = this.hexformat ? val.toString(16) : val.toString(); + var s = val.toString(radix); ctx.fillText(s, w-fh, ycen); } }