10 KiB
10 KiB
Project Findings
Repository Inventory
- Static/frontend files are under
frontend/:login.html,dashboard.html,canvas.html, andcanvas-helpers.js. - Backend files are under
backend/:server.py,database.py,pdk_access.py,technology_manifest.py,gds_builder.py, routing helpers, icons, anddirectories.yaml. - Persistent data appears under
database/, includingmxpic_data.db, saved layout YAML/SVG files, and generated_exports/*.gds. - Tests are JavaScript static/unit-style tests under
tests/. - Project docs exist under
docs/, including intranet deployment, GDS/SVG generation, and PDK technology loading notes. - A checked saved layout example at
database/engineer/layout/mxpic_project_1/mxpic_project_1.ymlcontains unresolved merge-conflict markers, so at least some local saved data may be invalid until cleaned. - Conflict-marker search also found real markers in
database/engineer/layout/mxpic_project_1/mxpic_project_1.svg,tests/layout-ui-wiring.test.js, andtests/layout-backend-static.test.js. backend/directories.yamlis a legacy/declarative directory category file with PDK-style categories; the active docs/source show library scanning is now driven by the role-scoped PDK filesystem.
Saved Layout YAML Shape
- Saved layout YAML uses schema version
2.0.0,kind: cell,coordinate_system: gds_y_up,canvas_size,project,name,type, andversion. - Modern YAML uses
pins,instances,elements, andbundles. instancescan reference basic components likecircle, generated/forge components, other project cells, or PDK paths such asSilterra/<technology>/primitives/....bundles.output_bus.linksstores routed connections with source/target pins and route settings.- Both checked
.project.jsonmetadata files (adminandengineer) select technologySilterra/EMO1_2ML_CU_Al_RDL.
README / Deployment
- The project is
mxpic_EDA, an EDA layout tool for OptiHK. - Runtime requirement explicitly listed in README is Flask.
- The application can launch login, dashboard, canvas editing, YAML generation, and PDK browsing without build-time router dependencies.
- Build/export actions require
mxpic_routerand Nazca; ifmxpic_forge.Routeis unavailable, routing falls back to Nazca interconnects. - SVG preview generation for routed/build output requires
gdstk. - Intranet server is started with
run_intranet_server.ps1and listens on0.0.0.0:3000by default. - LAN users browse to
http://<host-computer-ip>:3000; firewall must allow inbound TCP3000. - Default local accounts are
admin / 123456andengineer / 123456. - User project files are stored under
database/<username>/layout. - Important env vars include
MXPIC_SECRET_KEY,MXPIC_HOST,MXPIC_PORT,MXPIC_DEBUG,MXPIC_COOKIE_SECURE,MXPIC_PDK_PUBLIC_ROOT, andMXPIC_PDK_ATLAS_ROOT. - Public/developer PDK roots default to
../opt_pdk_public/foundries; manager/atlas roots default to../opt_pdk_atlas/foundries. run_intranet_server.ps1sets defaultMXPIC_SECRET_KEYif absent, setsMXPIC_HOST=0.0.0.0,MXPIC_PORT=3000,MXPIC_DEBUG=0, then runspython backend\server.py.backend/server.pyinitializes the local SQLite database when the server process starts.- Flask runs threaded on the configured host and port.
GDS / SVG Generation
Build Layoutserializes the active canvas page into layout YAML, posts it to/api/save-layout, writesdatabase/<username>/layout/<project>/<cell>.yml, writes optional route sidecar data, then calls router-backed SVG preview generation.- Routed SVG preview uses
backend/routed_layout_preview.py, which delegates tomxpic_router.build_project_gds, reads the temporary GDS withgdstk, and writes<cell>.svg. Build GDSposts to/api/build-gdswith only the project name. It does not automatically serialize unsaved in-memory canvas state first.- Final GDS export reads existing saved project YAML files, calls
backend/gds_builder.py, delegates tomxpic_router, writesdatabase/_exports/<uuid>/<project>.gds, returns a download URL, then cleans up the export folder after response close. - Saved layout files are under
database/<username>/layout/<project>/. - External build dependencies are lazy: normal web usage can work without router stack, while preview/build actions require
mxpic_router, Nazca, and sometimesgdstk.
PDK / Technology / Xsections
- PDK components, technology manifests, and GDS assets all come from role-scoped PDK roots.
- Dashboard loads available technologies from
/api/technologies, scanning<active_role_pdk_root>/<foundry>/<technology>/technology.yml. - Project creation stores selected technology in
database/<username>/layout/<project>/.project.json. - Canvas loads project metadata from
/api/projects/<project>, then loads/api/technologies/<foundry>/<technology>/manifest. technology.ymlsupplies layer mappings, routing type options, defaults, and xsection definitions such asstrip,rib_low,metal_1, andmetal_2.- Canvas route editing uses the active technology manifest to populate xsection choices and route defaults.
- Saved YAML stores component paths and per-link route data such as
xsection,family,width,radius, androuting_type. - Build-time router applies
technology.ymlto Nazca layers/xsections before resolving PDK assets and routing links.
Backend Route Surface
backend/server.pyserves/,/dashboard,/canvas,/canvas-helpers.js, and/logout.- Login endpoint is
POST /login. - Health check endpoint is
/api/health. - Account/profile endpoints include
/api/profile,/api/profile/password, and/api/logs. - Project endpoints include listing/creating
/api/projects, reading/deleting/api/projects/<project_name>, cell rename/delete under/api/projects/<project_name>/cells/<cell_name>, and/api/save-layout. - Build/export endpoints include
/api/build-gds,/api/exports/<export_id>/<filename>, and/api/projects/<project_name>/gds/<filename>. - PDK/technology endpoints include
/api/technologies,/api/technologies/<foundry>/<technology>/manifest,/api/library,/api/component/<component_name>,/api/component/<component_name>/image, and/api/icon/<category>. - Project listing treats each
.yml/.yamlinside a project folder as one saved cell/canvas. - Project creation sanitizes the requested name, adds a numeric suffix if needed, creates an initial project folder, writes
.project.json, and logsproject.create. /api/save-layoutacceptsproject,cell,content, and optionalpreviewflag./api/libraryrebuilds the component tree on each request so project technology and user role are reflected immediately.
Frontend Page Flow
frontend/login.htmlrenders a login form that submitsPOST /loginand then moves authenticated users into the dashboard.frontend/dashboard.htmlloads recent logs from/api/logs, profile data from/api/profile, projects from/api/projects, and technology choices from/api/technologies.- Opening a project navigates to
/canvas?project=<name>. - Creating a project posts
{ name, technology }to/api/projects. - Dashboard also supports deleting projects, updating occupation, and changing password through backend APIs.
frontend/canvas.htmlloads project metadata/cells from/api/projects/<project>, then loads the selected technology manifest.- Canvas loads the component library with
/api/library?project=<project>, component metadata from/api/component/<component_name>?project=<project>, and component images from/api/component/<component_name>/image?project=<project>. - Canvas save/build controls call
/api/save-layoutand/api/build-gds. - Dashboard
openProject(name)navigates directly to/canvas?project=<name>. - Canvas
loadTechnologyManifestfalls back toFALLBACK_TECHNOLOGY_MANIFESTwhen the saved technology is missing/invalid. - Canvas
fetchLibraryis project-scoped, so the visible library follows the selected project technology. - Canvas source comments define the control split:
handleBuildLayout: save active page, generate preview assets, show preview tab.handleSaveProjectLayouts: save YAML for every editable page without opening previews.handleBuildGds: build project GDS through the backend and trigger download.
Database
backend/database.pyuses SQLite atdatabase/mxpic_data.db.- Tables:
usersanduser_logs. - User records include password hash, creation date, credits, occupation, and
user_group. - Database migrations add missing columns to older local SQLite files.
- Default account roles are
admin -> manager,engineer -> developers, and ordinary users default touser. - Audit logs record user action, project/cell context, detail, IP address, and UTC timestamp.
PDK Access and Build Helpers
backend/pdk_access.pydefines supported user groups:manager,developers, anduser.- Managers resolve to
MXPIC_PDK_ATLAS_ROOToropt_pdk_atlas/foundries; developers/users resolve toMXPIC_PDK_PUBLIC_ROOToropt_pdk_public/foundries. - Only managers prefer full component GDS assets; other roles use public/black-box style assets.
- Temporary GDS exports are created in UUID folders and old export folders are cleaned up after an age threshold.
backend/gds_builder.pyvalidates that saved cell YAML files exist, then delegates all final GDS work tomxpic_router.build_project_gds.- Local GDS building is not implemented as a fallback in this repository.
Tests
- Tests are JavaScript assertion scripts in
tests/. - The test suite heavily checks static frontend/backend integration contracts, such as route existence, API strings, layout/GDS wiring, technology manifest loading, and PDK access behavior.
tests/canvas-helpers.test.jsdirectly importsfrontend/canvas-helpers.jsand checks handle placement, YAML serialization, route defaults, element ports, route YAML, and route crossing helpers.- Several tests intentionally assert that legacy local preview/registry modules are absent and that the router-backed preview/GDS path is present.
- Current checked test files include unresolved conflict markers in at least two files, so
nodetest execution may fail before assertions run unless those files are cleaned.
Open Questions
- None remaining for the requested project usage/workflow summary.