fixed trace timing and bitmap editor

This commit is contained in:
Steven Hugg 2018-07-04 09:36:32 -06:00
parent 5c1fdbf832
commit 4bb460a79b
4 changed files with 21 additions and 17 deletions

View File

@ -25,3 +25,6 @@ web:
ifconfig | grep inet
python2 -m SimpleHTTPServer 2>> http.out
tsweb:
ifconfig | grep inet
node ../nodejs-typescript-webserver/bin/FileServer.js .

View File

@ -41,6 +41,8 @@ TODO:
- update Javatari version? (and others?)
- WASM takes too long to load (esp. verilog)
(https://developers.google.com/web/updates/2018/04/loading-wasm)
- unify versioning
- more UI tests
WEB WORKER FORMAT
@ -50,7 +52,7 @@ WEB WORKER FORMAT
new:
{infiles,buildsteps}
{updates,buildsteps}
[{filepath,platform,tool}]
implicit rules

View File

@ -271,7 +271,7 @@ function _traceInstructions(pc, minclocks, maxclocks, subaddr, constraints) {
}
}
function showLoopTimingForPC(pc) {
function showLoopTimingForPC(pc, sourcefile, ed) {
pc2minclocks = {};
pc2maxclocks = {};
jsrresult = {};
@ -290,16 +290,11 @@ function showLoopTimingForPC(pc) {
s = minclocks + "-" + maxclocks;
if (maxclocks == MAX_CLOCKS)
s += "+";
getActiveEditor().setGutterBytes(line, s);
ed.setGutterBytes(line, s);
}
}
}
function traceTiming() {
trace_pending_at_pc = platform.getOriginPC();
setCode(getActiveEditor().getValue()); // TODO
}
///////////////
var VCSMAMEPlatform = function(mainElement) {

View File

@ -38,7 +38,6 @@ var main_file_id; // main file ID
var symbolmap; // symbol map
var addr2symbol; // address to symbol name map
var compparams; // received build params from worker
var trace_pending_at_pc; // true if clock trace (vcs)
var store; // persistent store
var lastDebugInfo; // last debug info (CPU text)
@ -178,6 +177,8 @@ function SourceEditor(path, mode) {
refreshDebugState();
dirtylisting = true;
}
self.getSourceFile = function() { return sourcefile; }
// TODO: update gutter only when refreshing this window
self.updateListing = function(_sourcefile) {
@ -1001,12 +1002,7 @@ function setCompileOutput(data) {
}
// update all windows (listings)
projectWindows.refresh();
// compute VCS cycle timing?
if (trace_pending_at_pc) {
showLoopTimingForPC(trace_pending_at_pc);
}
}
trace_pending_at_pc = null;
}
function showMemory(state) {
@ -1239,9 +1235,17 @@ function _fastestFrameRate() {
}
function _openBitmapEditor() {
var wnd = currentWindows.getActive();
var wnd = projectWindows.getActive();
if (wnd && wnd.openBitmapEditorAtCursor)
openBitmapEditorAtCursor();
wnd.openBitmapEditorAtCursor();
}
function traceTiming() {
projectWindows.refresh();
var wnd = projectWindows.getActive();
if (wnd.getSourceFile && wnd.setGutterBytes) { // is editor active?
showLoopTimingForPC(0, wnd.getSourceFile(), wnd);
}
}
function setupDebugControls(){
@ -1270,7 +1274,7 @@ function setupDebugControls(){
else
$("#dbg_stepback").hide();
if (window.traceTiming) {
if (window.showLoopTimingForPC) { // VCS-only (TODO: put in platform)
$("#dbg_timing").click(traceTiming).show();
}
$("#disassembly").hide();