From f8da33ec114594af581208df0a6160c00e1c2a11 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Tue, 15 Aug 2023 13:15:59 +0800 Subject: [PATCH] #fix sim --- .../netlist/view => css}/img/icon/cells.png | Bin .../netlist/view => css}/img/icon/main.png | Bin .../netlist/view => css}/img/icon/port.png | Bin .../netlist/view => css}/img/line_conn.gif | Bin .../netlist/view => css}/img/loading.gif | Bin .../netlist/view => css}/img/standard.png | Bin package.nls.json | 34 +++++++++--------- resources/netlist/index.js | 2 +- resources/netlist/view/render.js | 12 +++---- resources/public/svg-pan-zoom.min.js | 4 +-- src/extension.ts | 5 ++- src/function/lsp/completion/vlog.ts | 8 +++-- src/function/lsp/linter/vlog.ts | 2 +- src/function/lsp/util/index.ts | 1 + src/function/netlist/index.ts | 3 +- src/function/sim/simulate.ts | 2 +- src/global/prjInfo.ts | 25 ++++++++----- src/manager/prj.ts | 2 +- src/test/user/Hardware/src/Cordic.v | 3 +- syntaxes/verilog.tmLanguage.json | 6 ++-- 20 files changed, 62 insertions(+), 47 deletions(-) rename {resources/netlist/view => css}/img/icon/cells.png (100%) rename {resources/netlist/view => css}/img/icon/main.png (100%) rename {resources/netlist/view => css}/img/icon/port.png (100%) rename {resources/netlist/view => css}/img/line_conn.gif (100%) rename {resources/netlist/view => css}/img/loading.gif (100%) rename {resources/netlist/view => css}/img/standard.png (100%) diff --git a/resources/netlist/view/img/icon/cells.png b/css/img/icon/cells.png similarity index 100% rename from resources/netlist/view/img/icon/cells.png rename to css/img/icon/cells.png diff --git a/resources/netlist/view/img/icon/main.png b/css/img/icon/main.png similarity index 100% rename from resources/netlist/view/img/icon/main.png rename to css/img/icon/main.png diff --git a/resources/netlist/view/img/icon/port.png b/css/img/icon/port.png similarity index 100% rename from resources/netlist/view/img/icon/port.png rename to css/img/icon/port.png diff --git a/resources/netlist/view/img/line_conn.gif b/css/img/line_conn.gif similarity index 100% rename from resources/netlist/view/img/line_conn.gif rename to css/img/line_conn.gif diff --git a/resources/netlist/view/img/loading.gif b/css/img/loading.gif similarity index 100% rename from resources/netlist/view/img/loading.gif rename to css/img/loading.gif diff --git a/resources/netlist/view/img/standard.png b/css/img/standard.png similarity index 100% rename from resources/netlist/view/img/standard.png rename to css/img/standard.png diff --git a/package.nls.json b/package.nls.json index 4151a78..8b61ac7 100644 --- a/package.nls.json +++ b/package.nls.json @@ -7,9 +7,9 @@ "digital-ide.tool.instance.title": "Generate instance template from selected module", "digital-ide.tool.testbench.title": "Generate testbench template from current file", "digital-ide.tool.icarus.simulateFile.title": "Do simulation for current file", - "digital-ide.treeView.arch.expand.title": "expand all the items in tree view", - "digital-ide.treeView.arch.collapse.title": "collapse all the items in tree view", - "digital-ide.treeView.arch.refresh.title": "refresh the tree view", + "digital-ide.treeView.arch.expand.title": "Expand all the items in tree view", + "digital-ide.treeView.arch.collapse.title": "Collapse all the items in tree view", + "digital-ide.treeView.arch.refresh.title": "Refresh the tree view", "digital-ide.treeView.arch.openFile.title": "Open the corresponding file in tree view", "digital-ide.tool.clean.title": "Clean the current project", "digital-ide.soft.launch.title": "Launch SDK development assist function", @@ -27,18 +27,18 @@ "digital-ide.hard.program.title": "Download the bit file into the device", "digital-ide.hard.gui.title": "Open the GUI", "digital-ide.hard.exit.title": "Exit the current project", - "digital-ide.pickLibrary.title": "select lib from custom & common", - "digital-ide.pl.setSrcTop.title": "set as top file of src", - "digital-ide.pl.setSimTop.title": "set as top file of sim", - "digital-ide.pl.addDevice.title": "add device", - "digital-ide.pl.delDevice.title": "del device", - "digital-ide.pl.addFile.title": "add file", - "digital-ide.pl.delFile.title": "del file", - "digital-ide.netlist.title": "netlist", - "digital-ide.fsm.title": "finite state machine", - "digital-ide.lsp.tool.insertTextToUri.title": "insert text to uri", - "digital-ide.lsp.tool.transformOldPropertyFile.title": "transform configure file from previous version to new version", - "digital-ide.vhdl2vlog.title": "translate vhdl code to verilog code", - "digital-ide.fsm.show.title": "show FSM graph of current file", - "digital-ide.netlist.show.title": "show netlist of current file" + "digital-ide.pickLibrary.title": "Select lib from custom & common", + "digital-ide.pl.setSrcTop.title": "Set as top file of src", + "digital-ide.pl.setSimTop.title": "Set as top file of sim", + "digital-ide.pl.addDevice.title": "Add device", + "digital-ide.pl.delDevice.title": "Del device", + "digital-ide.pl.addFile.title": "Add file", + "digital-ide.pl.delFile.title": "Del file", + "digital-ide.netlist.title": "Netlist", + "digital-ide.fsm.title": "Finite state machine", + "digital-ide.lsp.tool.insertTextToUri.title": "Insert text to uri", + "digital-ide.lsp.tool.transformOldPropertyFile.title": "Transform configure file from previous version to new version", + "digital-ide.vhdl2vlog.title": "Translate vhdl code to verilog code", + "digital-ide.fsm.show.title": "Show FSM graph of current file", + "digital-ide.netlist.show.title": "Show netlist of current file" } \ No newline at end of file diff --git a/resources/netlist/index.js b/resources/netlist/index.js index 0c7f466..698df11 100644 --- a/resources/netlist/index.js +++ b/resources/netlist/index.js @@ -67,7 +67,7 @@ class NetlistKernel { for (let i = 0; i < files.length; i++) { const file = files[i]; if (os.platform().toLowerCase() === 'win32') { - console.log(this.kernel.FS.readdir('/')); + // console.log(this.kernel.FS.readdir('/')); this.exec(`${command} /${file}`); } else { this.exec(`${command} /host/${file}`); diff --git a/resources/netlist/view/render.js b/resources/netlist/view/render.js index ebc633b..7c923ca 100644 --- a/resources/netlist/view/render.js +++ b/resources/netlist/view/render.js @@ -22,10 +22,10 @@ class render{ document.getElementById("next").onclick = function () { if (this.curNetIndex < this.netLists.length-1) { - this.curNetIndex++; + this.curNetIndex ++; this.showNetlist(this.netLists[this.curNetIndex]); } - }; + }; } async showNetlist(netList, isClear) { @@ -35,15 +35,15 @@ class render{ this.netLists.push(netList); } - let netnode = this.showTreelist(netList); + const netnode = this.showTreelist(netList); - var setting = {}; - $(document).ready(function () { + const setting = {}; + $(document).ready(() => { this.zTreeObj = $.fn.zTree.init($("#netTree"), setting, netnode); }); // remove embed - svgPanZoom(this.embed_svg).destroy(); + // svgPanZoom(this.embed_svg).destroy(); this.svg = await netlistsvg.render(netlistsvg.digitalSkin, netList); //Add to container diff --git a/resources/public/svg-pan-zoom.min.js b/resources/public/svg-pan-zoom.min.js index 807f0e4..4904d12 100644 --- a/resources/public/svg-pan-zoom.min.js +++ b/resources/public/svg-pan-zoom.min.js @@ -1,3 +1,3 @@ -// svg-pan-zoom v3.6.0 +// svg-pan-zoom v3.6.1 // https://github.com/ariutta/svg-pan-zoom -!function t(e,o,n){function i(r,a){if(!o[r]){if(!e[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(s)return s(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var h=o[r]={exports:{}};e[r][0].call(h.exports,function(t){var o=e[r][1][t];return i(o?o:t)},h,h.exports,t,e,o,n)}return o[r].exports}for(var s="function"==typeof require&&require,r=0;r=0;n--)this.eventListeners.hasOwnProperty(o[n])&&delete this.eventListeners[o[n]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],!this.options.preventMouseEventsDefault&&h);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},l.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var t=this;this.wheelListener=function(e){return t.handleMouseWheel(e)};var e=!this.options.preventMouseEventsDefault;n.on(this.options.eventsListenerElement||this.svg,this.wheelListener,e),this.options.mouseWheelZoomEnabled=!0}},l.prototype.disableMouseWheelZoom=function(){if(this.options.mouseWheelZoomEnabled){var t=!this.options.preventMouseEventsDefault;n.off(this.options.eventsListenerElement||this.svg,this.wheelListener,t),this.options.mouseWheelZoomEnabled=!1}},l.prototype.handleMouseWheel=function(t){if(this.options.zoomEnabled&&"none"===this.state){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var e=t.deltaY||1,o=Date.now()-this.lastMouseWheelEventTime,n=3+Math.max(0,30-o);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in t&&0===t.deltaMode&&t.wheelDelta&&(e=0===t.deltaY?0:Math.abs(t.wheelDelta)/t.deltaY),e=-.30?1:-1)*Math.log(Math.abs(e)+10)/n;var i=this.svg.getScreenCTM().inverse(),s=r.getEventPoint(t,this.svg).matrixTransform(i),a=Math.pow(1+this.options.zoomScaleSensitivity,-1*e);this.zoomAtPoint(a,s)}},l.prototype.zoomAtPoint=function(t,e,o){var n=this.viewport.getOriginalState();o?(t=Math.max(this.options.minZoom*n.zoom,Math.min(this.options.maxZoom*n.zoom,t)),t/=this.getZoom()):this.getZoom()*tthis.options.maxZoom*n.zoom&&(t=this.options.maxZoom*n.zoom/this.getZoom());var i=this.viewport.getCTM(),s=e.matrixTransform(i.inverse()),r=this.svg.createSVGMatrix().translate(s.x,s.y).scale(t).translate(-s.x,-s.y),a=i.multiply(r);a.a!==i.a&&this.viewport.setCTM(a)},l.prototype.zoom=function(t,e){this.zoomAtPoint(t,r.getSvgCenterPoint(this.svg,this.width,this.height),e)},l.prototype.publicZoom=function(t,e){e&&(t=this.computeFromRelativeZoom(t)),this.zoom(t,e)},l.prototype.publicZoomAtPoint=function(t,e,o){if(o&&(t=this.computeFromRelativeZoom(t)),"SVGPoint"!==s.getType(e)){if(!("x"in e&&"y"in e))throw new Error("Given point is invalid");e=r.createSVGPoint(this.svg,e.x,e.y)}this.zoomAtPoint(t,e,o)},l.prototype.getZoom=function(){return this.viewport.getZoom()},l.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},l.prototype.computeFromRelativeZoom=function(t){return t*this.viewport.getOriginalState().zoom},l.prototype.resetZoom=function(){var t=this.viewport.getOriginalState();this.zoom(t.zoom,!0)},l.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},l.prototype.reset=function(){this.resetZoom(),this.resetPan()},l.prototype.handleDblClick=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.options.controlIconsEnabled){var e=t.target.getAttribute("class")||"";if(e.indexOf("svg-pan-zoom-control")>-1)return!1}var o;o=t.shiftKey?1/(2*(1+this.options.zoomScaleSensitivity)):2*(1+this.options.zoomScaleSensitivity);var n=r.getEventPoint(t,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(o,n)},l.prototype.handleMouseDown=function(t,e){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),s.mouseAndTouchNormalize(t,this.svg),this.options.dblClickZoomEnabled&&s.isDblClick(t,e)?this.handleDblClick(t):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=r.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()))},l.prototype.handleMouseMove=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&this.options.panEnabled){var e=r.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()),o=this.firstEventCTM.translate(e.x-this.stateOrigin.x,e.y-this.stateOrigin.y);this.viewport.setCTM(o)}},l.prototype.handleMouseUp=function(t){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&(this.state="none")},l.prototype.fit=function(){var t=this.viewport.getViewBox(),e=Math.min(this.width/t.width,this.height/t.height);this.zoom(e,!0)},l.prototype.contain=function(){var t=this.viewport.getViewBox(),e=Math.max(this.width/t.width,this.height/t.height);this.zoom(e,!0)},l.prototype.center=function(){var t=this.viewport.getViewBox(),e=.5*(this.width-(t.width+2*t.x)*this.getZoom()),o=.5*(this.height-(t.height+2*t.y)*this.getZoom());this.getPublicInstance().pan({x:e,y:o})},l.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},l.prototype.pan=function(t){var e=this.viewport.getCTM();e.e=t.x,e.f=t.y,this.viewport.setCTM(e)},l.prototype.panBy=function(t){var e=this.viewport.getCTM();e.e+=t.x,e.f+=t.y,this.viewport.setCTM(e)},l.prototype.getPan=function(){var t=this.viewport.getState();return{x:t.x,y:t.y}},l.prototype.resize=function(){var t=r.getBoundingClientRectNormalized(this.svg);this.width=t.width,this.height=t.height;var e=this.viewport;e.options.width=this.width,e.options.height=this.height,e.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},l.prototype.destroy=function(){var t=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,null!=this.options.customEventsHandler&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var e in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(e,this.eventListeners[e],!this.options.preventMouseEventsDefault&&h);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),c=c.filter(function(e){return e.svg!==t.svg}),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},l.prototype.getPublicInstance=function(){var t=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return t.options.panEnabled=!0,t.pi},disablePan:function(){return t.options.panEnabled=!1,t.pi},isPanEnabled:function(){return!!t.options.panEnabled},pan:function(e){return t.pan(e),t.pi},panBy:function(e){return t.panBy(e),t.pi},getPan:function(){return t.getPan()},setBeforePan:function(e){return t.options.beforePan=null===e?null:s.proxy(e,t.publicInstance),t.pi},setOnPan:function(e){return t.options.onPan=null===e?null:s.proxy(e,t.publicInstance),t.pi},enableZoom:function(){return t.options.zoomEnabled=!0,t.pi},disableZoom:function(){return t.options.zoomEnabled=!1,t.pi},isZoomEnabled:function(){return!!t.options.zoomEnabled},enableControlIcons:function(){return t.options.controlIconsEnabled||(t.options.controlIconsEnabled=!0,i.enable(t)),t.pi},disableControlIcons:function(){return t.options.controlIconsEnabled&&(t.options.controlIconsEnabled=!1,i.disable(t)),t.pi},isControlIconsEnabled:function(){return!!t.options.controlIconsEnabled},enableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!0,t.pi},disableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!1,t.pi},isDblClickZoomEnabled:function(){return!!t.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return t.enableMouseWheelZoom(),t.pi},disableMouseWheelZoom:function(){return t.disableMouseWheelZoom(),t.pi},isMouseWheelZoomEnabled:function(){return!!t.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(e){return t.options.zoomScaleSensitivity=e,t.pi},setMinZoom:function(e){return t.options.minZoom=e,t.pi},setMaxZoom:function(e){return t.options.maxZoom=e,t.pi},setBeforeZoom:function(e){return t.options.beforeZoom=null===e?null:s.proxy(e,t.publicInstance),t.pi},setOnZoom:function(e){return t.options.onZoom=null===e?null:s.proxy(e,t.publicInstance),t.pi},zoom:function(e){return t.publicZoom(e,!0),t.pi},zoomBy:function(e){return t.publicZoom(e,!1),t.pi},zoomAtPoint:function(e,o){return t.publicZoomAtPoint(e,o,!0),t.pi},zoomAtPointBy:function(e,o){return t.publicZoomAtPoint(e,o,!1),t.pi},zoomIn:function(){return this.zoomBy(1+t.options.zoomScaleSensitivity),t.pi},zoomOut:function(){return this.zoomBy(1/(1+t.options.zoomScaleSensitivity)),t.pi},getZoom:function(){return t.getRelativeZoom()},setOnUpdatedCTM:function(e){return t.options.onUpdatedCTM=null===e?null:s.proxy(e,t.publicInstance),t.pi},resetZoom:function(){return t.resetZoom(),t.pi},resetPan:function(){return t.resetPan(),t.pi},reset:function(){return t.reset(),t.pi},fit:function(){return t.fit(),t.pi},contain:function(){return t.contain(),t.pi},center:function(){return t.center(),t.pi},updateBBox:function(){return t.updateBBox(),t.pi},resize:function(){return t.resize(),t.pi},getSizes:function(){return{width:t.width,height:t.height,realZoom:t.getZoom(),viewBox:t.viewport.getViewBox()}},destroy:function(){return t.destroy(),t.pi}}),this.publicInstance};var c=[],p=function(t,e){var o=s.getSvg(t);if(null===o)return null;for(var n=c.length-1;n>=0;n--)if(c[n].svg===o)return c[n].instance.getPublicInstance();return c.push({svg:o,instance:new l(o,e)}),c[c.length-1].instance.getPublicInstance()};e.exports=p},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(t,e,o){var n=t("./utilities"),i="unknown";document.documentMode&&(i="ie"),e.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(t){if(t.clientWidth&&t.clientHeight)return{width:t.clientWidth,height:t.clientHeight};if(t.getBoundingClientRect())return t.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(t,e){var o=null;if(o=n.isElement(e)?e:t.querySelector(e),!o){var i=Array.prototype.slice.call(t.childNodes||t.children).filter(function(t){return"defs"!==t.nodeName&&"#text"!==t.nodeName});1===i.length&&"g"===i[0].nodeName&&null===i[0].getAttribute("transform")&&(o=i[0])}if(!o){var s="viewport-"+(new Date).toISOString().replace(/\D/g,"");o=document.createElementNS(this.svgNS,"g"),o.setAttribute("id",s);var r=t.childNodes||t.children;if(r&&r.length>0)for(var a=r.length;a>0;a--)"defs"!==r[r.length-a].nodeName&&o.appendChild(r[r.length-a]);t.appendChild(o)}var l=[];return o.getAttribute("class")&&(l=o.getAttribute("class").split(" ")),~l.indexOf("svg-pan-zoom_viewport")||(l.push("svg-pan-zoom_viewport"),o.setAttribute("class",l.join(" "))),o},setupSvgAttributes:function(t){if(t.setAttribute("xmlns",this.svgNS),t.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),t.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),null!==t.parentNode){var e=t.getAttribute("style")||"";e.toLowerCase().indexOf("overflow")===-1&&t.setAttribute("style","overflow: hidden; "+e)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:n.throttle(function(){for(var t=document.querySelectorAll("defs"),e=t.length,o=0;oe?(clearTimeout(a),a=null,l=h,s=t.apply(n,i),a||(n=i=null)):a||o.trailing===!1||(a=setTimeout(u,c)),s}},createRequestAnimationFrame:function(t){var e=null;return"auto"!==t&&t<60&&t>1&&(e=Math.floor(1e3/t)),null===e?window.requestAnimationFrame||n(33):n(e)}}},{}]},{},[1]); \ No newline at end of file +!function s(r,a,l){function u(e,t){if(!a[e]){if(!r[e]){var o="function"==typeof require&&require;if(!t&&o)return o(e,!0);if(h)return h(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=a[e]={exports:{}};r[e][0].call(i.exports,function(t){return u(r[e][1][t]||t)},i,i.exports,s,r,a,l)}return a[e].exports}for(var h="function"==typeof require&&require,t=0;tthis.options.maxZoom*n.zoom&&(t=this.options.maxZoom*n.zoom/this.getZoom());var i=this.viewport.getCTM(),s=e.matrixTransform(i.inverse()),r=this.svg.createSVGMatrix().translate(s.x,s.y).scale(t).translate(-s.x,-s.y),a=i.multiply(r);a.a!==i.a&&this.viewport.setCTM(a)},i.prototype.zoom=function(t,e){this.zoomAtPoint(t,a.getSvgCenterPoint(this.svg,this.width,this.height),e)},i.prototype.publicZoom=function(t,e){e&&(t=this.computeFromRelativeZoom(t)),this.zoom(t,e)},i.prototype.publicZoomAtPoint=function(t,e,o){if(o&&(t=this.computeFromRelativeZoom(t)),"SVGPoint"!==r.getType(e)){if(!("x"in e&&"y"in e))throw new Error("Given point is invalid");e=a.createSVGPoint(this.svg,e.x,e.y)}this.zoomAtPoint(t,e,o)},i.prototype.getZoom=function(){return this.viewport.getZoom()},i.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},i.prototype.computeFromRelativeZoom=function(t){return t*this.viewport.getOriginalState().zoom},i.prototype.resetZoom=function(){var t=this.viewport.getOriginalState();this.zoom(t.zoom,!0)},i.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},i.prototype.reset=function(){this.resetZoom(),this.resetPan()},i.prototype.handleDblClick=function(t){var e;if((this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.options.controlIconsEnabled)&&-1<(t.target.getAttribute("class")||"").indexOf("svg-pan-zoom-control"))return!1;e=t.shiftKey?1/(2*(1+this.options.zoomScaleSensitivity)):2*(1+this.options.zoomScaleSensitivity);var o=a.getEventPoint(t,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(e,o)},i.prototype.handleMouseDown=function(t,e){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),r.mouseAndTouchNormalize(t,this.svg),this.options.dblClickZoomEnabled&&r.isDblClick(t,e)?this.handleDblClick(t):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=a.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()))},i.prototype.handleMouseMove=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&this.options.panEnabled){var e=a.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()),o=this.firstEventCTM.translate(e.x-this.stateOrigin.x,e.y-this.stateOrigin.y);this.viewport.setCTM(o)}},i.prototype.handleMouseUp=function(t){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),"pan"===this.state&&(this.state="none")},i.prototype.fit=function(){var t=this.viewport.getViewBox(),e=Math.min(this.width/t.width,this.height/t.height);this.zoom(e,!0)},i.prototype.contain=function(){var t=this.viewport.getViewBox(),e=Math.max(this.width/t.width,this.height/t.height);this.zoom(e,!0)},i.prototype.center=function(){var t=this.viewport.getViewBox(),e=.5*(this.width-(t.width+2*t.x)*this.getZoom()),o=.5*(this.height-(t.height+2*t.y)*this.getZoom());this.getPublicInstance().pan({x:e,y:o})},i.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},i.prototype.pan=function(t){var e=this.viewport.getCTM();e.e=t.x,e.f=t.y,this.viewport.setCTM(e)},i.prototype.panBy=function(t){var e=this.viewport.getCTM();e.e+=t.x,e.f+=t.y,this.viewport.setCTM(e)},i.prototype.getPan=function(){var t=this.viewport.getState();return{x:t.x,y:t.y}},i.prototype.resize=function(){var t=a.getBoundingClientRectNormalized(this.svg);this.width=t.width,this.height=t.height;var e=this.viewport;e.options.width=this.width,e.options.height=this.height,e.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},i.prototype.destroy=function(){var e=this;for(var t in this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,(this.onUpdatedCTM=null)!=this.options.customEventsHandler&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()}),this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(t,this.eventListeners[t],!this.options.preventMouseEventsDefault&&h);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),c=c.filter(function(t){return t.svg!==e.svg}),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},i.prototype.getPublicInstance=function(){var o=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return o.options.panEnabled=!0,o.pi},disablePan:function(){return o.options.panEnabled=!1,o.pi},isPanEnabled:function(){return!!o.options.panEnabled},pan:function(t){return o.pan(t),o.pi},panBy:function(t){return o.panBy(t),o.pi},getPan:function(){return o.getPan()},setBeforePan:function(t){return o.options.beforePan=null===t?null:r.proxy(t,o.publicInstance),o.pi},setOnPan:function(t){return o.options.onPan=null===t?null:r.proxy(t,o.publicInstance),o.pi},enableZoom:function(){return o.options.zoomEnabled=!0,o.pi},disableZoom:function(){return o.options.zoomEnabled=!1,o.pi},isZoomEnabled:function(){return!!o.options.zoomEnabled},enableControlIcons:function(){return o.options.controlIconsEnabled||(o.options.controlIconsEnabled=!0,s.enable(o)),o.pi},disableControlIcons:function(){return o.options.controlIconsEnabled&&(o.options.controlIconsEnabled=!1,s.disable(o)),o.pi},isControlIconsEnabled:function(){return!!o.options.controlIconsEnabled},enableDblClickZoom:function(){return o.options.dblClickZoomEnabled=!0,o.pi},disableDblClickZoom:function(){return o.options.dblClickZoomEnabled=!1,o.pi},isDblClickZoomEnabled:function(){return!!o.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return o.enableMouseWheelZoom(),o.pi},disableMouseWheelZoom:function(){return o.disableMouseWheelZoom(),o.pi},isMouseWheelZoomEnabled:function(){return!!o.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(t){return o.options.zoomScaleSensitivity=t,o.pi},setMinZoom:function(t){return o.options.minZoom=t,o.pi},setMaxZoom:function(t){return o.options.maxZoom=t,o.pi},setBeforeZoom:function(t){return o.options.beforeZoom=null===t?null:r.proxy(t,o.publicInstance),o.pi},setOnZoom:function(t){return o.options.onZoom=null===t?null:r.proxy(t,o.publicInstance),o.pi},zoom:function(t){return o.publicZoom(t,!0),o.pi},zoomBy:function(t){return o.publicZoom(t,!1),o.pi},zoomAtPoint:function(t,e){return o.publicZoomAtPoint(t,e,!0),o.pi},zoomAtPointBy:function(t,e){return o.publicZoomAtPoint(t,e,!1),o.pi},zoomIn:function(){return this.zoomBy(1+o.options.zoomScaleSensitivity),o.pi},zoomOut:function(){return this.zoomBy(1/(1+o.options.zoomScaleSensitivity)),o.pi},getZoom:function(){return o.getRelativeZoom()},setOnUpdatedCTM:function(t){return o.options.onUpdatedCTM=null===t?null:r.proxy(t,o.publicInstance),o.pi},resetZoom:function(){return o.resetZoom(),o.pi},resetPan:function(){return o.resetPan(),o.pi},reset:function(){return o.reset(),o.pi},fit:function(){return o.fit(),o.pi},contain:function(){return o.contain(),o.pi},center:function(){return o.center(),o.pi},updateBBox:function(){return o.updateBBox(),o.pi},resize:function(){return o.resize(),o.pi},getSizes:function(){return{width:o.width,height:o.height,realZoom:o.getZoom(),viewBox:o.viewport.getViewBox()}},destroy:function(){return o.destroy(),o.pi}}),this.publicInstance};var c=[];e.exports=function(t,e){var o=r.getSvg(t);if(null===o)return null;for(var n=c.length-1;0<=n;n--)if(c[n].svg===o)return c[n].instance.getPublicInstance();return c.push({svg:o,instance:new i(o,e)}),c[c.length-1].instance.getPublicInstance()}},{"./control-icons":1,"./shadow-viewport":2,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(t,e,o){var l=t("./utilities"),s="unknown";document.documentMode&&(s="ie"),e.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(t){if(t.clientWidth&&t.clientHeight)return{width:t.clientWidth,height:t.clientHeight};if(t.getBoundingClientRect())return t.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(t,e){var o=null;if(!(o=l.isElement(e)?e:t.querySelector(e))){var n=Array.prototype.slice.call(t.childNodes||t.children).filter(function(t){return"defs"!==t.nodeName&&"#text"!==t.nodeName});1===n.length&&"g"===n[0].nodeName&&null===n[0].getAttribute("transform")&&(o=n[0])}if(!o){var i="viewport-"+(new Date).toISOString().replace(/\D/g,"");(o=document.createElementNS(this.svgNS,"g")).setAttribute("id",i);var s=t.childNodes||t.children;if(s&&0 | null | undefined> { - // console.log('VlogPositionPortProvider'); + console.log('enter VlogPositionPortProvider'); try { const suggestPositionPorts: vscode.CompletionItem[] = []; const filePath = hdlPath.toSlash(document.fileName); const symbolResult = await vlogSymbolStorage.getSymbol(filePath); - if (!symbolResult) { + + // console.log(symbolResult?.content); + // console.log(position.character, position.line); + + if (!symbolResult) { return null; } diff --git a/src/function/lsp/linter/vlog.ts b/src/function/lsp/linter/vlog.ts index 5ae17a0..776ed64 100644 --- a/src/function/lsp/linter/vlog.ts +++ b/src/function/lsp/linter/vlog.ts @@ -14,7 +14,7 @@ class VlogLinter { async lint(document: vscode.TextDocument) { const filePath = document.fileName; const vlogAll = await vlogSymbolStorage.getSymbol(filePath); - console.log('lint all finish'); + // console.log('lint all finish'); if (vlogAll) { const diagnostics = this.provideDiagnostics(document, vlogAll); diff --git a/src/function/lsp/util/index.ts b/src/function/lsp/util/index.ts index 7dfc0fe..5f34a81 100644 --- a/src/function/lsp/util/index.ts +++ b/src/function/lsp/util/index.ts @@ -203,6 +203,7 @@ function filterInstanceByPosition(position: vscode.Position, symbols: RawSymbol[ } for (const symbol of symbols) { const inst = module.getInstance(symbol.name); + if (positionAfterEqual(position, symbol.range.start) && positionAfterEqual(symbol.range.end, position) && inst) { diff --git a/src/function/netlist/index.ts b/src/function/netlist/index.ts index 09ca72d..5f8c87e 100644 --- a/src/function/netlist/index.ts +++ b/src/function/netlist/index.ts @@ -2,7 +2,7 @@ import * as vscode from 'vscode'; import * as fspath from 'path'; import { NetlistKernel } from '../../../resources/netlist'; -import { MainOutput, opeParam, ReportType, YosysOutput } from '../../global'; +import { opeParam, ReportType, YosysOutput } from '../../global'; import { hdlParam } from '../../hdlParser'; import { hdlFile, hdlPath } from '../../hdlFs'; @@ -54,6 +54,7 @@ class Netlist { } }); + prjFiles.forEach(file => YosysOutput.report('feed file: ' + file, ReportType.Debug)); this.kernel.load(prjFiles); this.create(); } diff --git a/src/function/sim/simulate.ts b/src/function/sim/simulate.ts index 88897d1..649f488 100644 --- a/src/function/sim/simulate.ts +++ b/src/function/sim/simulate.ts @@ -216,7 +216,7 @@ class IcarusSimulate extends Simulate { const outVvpPath = '"' + hdlPath.join(simConfig.simulationHome, 'out.vvp') + '"'; const mainPath = '"' + path + '"'; - const cmd = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name} ${macroIncludeArgs} ${mainPath} ${dependenceArgs} ${thirdLibraryArgs}`; + const cmd = `${iverilogPath} ${argu} -o ${outVvpPath} -s ${name} ${macroIncludeArgs} ${thirdLibraryArgs} ${mainPath} ${dependenceArgs}`; MainOutput.report(cmd, ReportType.Run); return cmd; } diff --git a/src/global/prjInfo.ts b/src/global/prjInfo.ts index 901a375..e9bcb47 100644 --- a/src/global/prjInfo.ts +++ b/src/global/prjInfo.ts @@ -58,15 +58,15 @@ const PrjInfoDefaults: PrjInfoMeta = { get arch() { return { - prjPath: '.', + prjPath: '', hardware: { - src: '.', - sim: '.', - data: '.' + src: '', + sim: '', + data: '' }, software: { - src: '.', - data: '.' + src: '', + data: '' } }; }, @@ -476,7 +476,7 @@ class PrjInfo implements PrjInfoMeta { if (iverilogCompileOptions.standard) { this._iverilogCompileOptions.standard = iverilogCompileOptions.standard; } - if (iverilogCompileOptions.includes && iverilogCompileOptions.includes instanceof Array) { + if (iverilogCompileOptions.includes && iverilogCompileOptions.includes instanceof Array) { this._iverilogCompileOptions.includes = []; for (const includePath of iverilogCompileOptions.includes) { const realIncludePath = includePath.replace(/\$\{workspace\}/g, this._workspacePath); @@ -567,19 +567,26 @@ class PrjInfo implements PrjInfoMeta { public get hardwareSimPath(): AbsPath { const simPath = this._arch.hardware.sim; + const workspace = this._workspacePath; if (fspath.isAbsolute(simPath)) { return simPath; + } else if (simPath === '') { + return workspace; } - const workspace = this._workspacePath; return hdlPath.join(workspace, simPath); } public get hardwareSrcPath(): AbsPath { const srcPath = this._arch.hardware.src; + const workspace = this._workspacePath; + if (fspath.isAbsolute(srcPath)) { return srcPath; + } else if (srcPath === '') { + return workspace; } - const workspace = this._workspacePath; + console.log(hdlPath.join(workspace, srcPath)); + return hdlPath.join(workspace, srcPath); } diff --git a/src/manager/prj.ts b/src/manager/prj.ts index 4c5f673..5a5eae7 100644 --- a/src/manager/prj.ts +++ b/src/manager/prj.ts @@ -120,7 +120,7 @@ class PrjManage { // do search const searchPaths = searchPathSet.files; - const hdlFiles = hdlFile.getHDLFiles(searchPaths, ignores); + const hdlFiles = hdlFile.getHDLFiles(searchPaths, ignores); return hdlFiles; } diff --git a/src/test/user/Hardware/src/Cordic.v b/src/test/user/Hardware/src/Cordic.v index bf52c75..a5a2fba 100644 --- a/src/test/user/Hardware/src/Cordic.v +++ b/src/test/user/Hardware/src/Cordic.v @@ -16,8 +16,7 @@ module Cordic #( output signed [XY_BITS-1:0] x_o, output signed [XY_BITS-1:0] y_o, output signed [PH_BITS-1:0] phase_out, - - input valid_in, + input valid_in, output valid_out ); diff --git a/syntaxes/verilog.tmLanguage.json b/syntaxes/verilog.tmLanguage.json index 10c5d78..c6491e3 100644 --- a/syntaxes/verilog.tmLanguage.json +++ b/syntaxes/verilog.tmLanguage.json @@ -10,10 +10,10 @@ "include": "#comments" }, { - "include": "#module_pattern" + "include": "#keywords" }, { - "include": "#keywords" + "include": "#module_pattern" }, { "include": "#constants" @@ -125,7 +125,7 @@ "name": "punctuation.terminator.expression.verilog" } }, - "name": "meta.block.instantiation.parameterless.verilog", + "name": "variable.other.constant.instantiation.parameterless.verilog", "patterns": [ { "include": "#comments"