updated with github

This commit is contained in:
2026-05-26 11:55:56 +08:00
parent 4709bb791b
commit 809f73c1f5
11 changed files with 1818 additions and 482 deletions
@@ -0,0 +1,35 @@
name: EC_SiN400_1310_1p0dB_L635_A0_QY_202604
foundry: Silterra
process: EMO1_2ML_Cu_RDL
year: '2026'
type: primitive
dependency: None
maturity: development
tapeout_history:
- run: Silterra_EMO1_2ML_Cu_RDL_2026_Q2
status: Pending testing
center_wavelength: 1310
version: 1.0
designer: Qin Yue
update_notes: New SiN edge couplers with high efficiency
ports:
a1:
x: -642.6
y: 0.0
a: 180.0
width: 0.7
b0:
x: 0.0
y: 0.0
a: 0.0
width: None
a0:
x: 0.0
y: 0.0
a: 180.0
width: 0.0
time: 20260505-170136
box_size:
- 646.0
- 75.0
file_size: 1.36 KB
+17
View File
@@ -0,0 +1,17 @@
level : 4
root :
- PDK_libs
- primitives
- directional_couplers
- edge_couplers
- crossings
- multimode_interferometers
- photodectors
- compotites
- MZIs
- electronics
- resistors
- capacitors
- others
- logos
+62
View File
@@ -0,0 +1,62 @@
# =============================================
# mxPIC Cell/Project Definition File
# =============================================
name: comp_1
type: composite
version: "1.0.0"
# 1. External Ports (How this cell connects to the outside world)
ports:
- name: in0
layer: WG_CORE
x: 0.0
y: 0.0
angle: 180.0
width: 0.5
- name: out0
layer: WG_CORE
x: 100.0
y: 10.0
angle: 0.0
width: 0.5
- name: out1
layer: WG_CORE
x: 100.0
y: -10.0
angle: 0.0
width: 0.5
# 2. Instances (The sub-components dropped onto this canvas)
instances:
component_1:
component: EMO1_2ML_CU_Al_RDL/composite/Mach_Zender_modulators/MZM_800G_L3000_GSSG_TRAIL_TypeX5_QY_v1_20260303
x: 100.0
y: 100.0
rotation: 0.0
mirror: false
settings:
length:
component_2:
component: EMO1_2ML_CU_Al_RDL/electronics/inductors/INDC_200pH_SiNPP_QY_202604
x: 400.0
y: 100.0
rotation: 0.0
mirror: false
settings:
length:
component_3:
component: EMO1_2ML_CU_Al_RDL/electronics/pads/Spec_PADs_ABCD_292_P125_250_W80_80_QY_20260324
x: 700.0
y: 100.0
rotation: 0.0
mirror: false
settings:
length:
# 3. Bundles (Grouped links for multi-bus/parallel routing)
bundles:
output_bus:
routing_type: euler_bend
links:
Binary file not shown.
+45 -105
View File
@@ -1,103 +1,3 @@
# import os
# import yaml
# from collections import OrderedDict
# from flask import Flask, jsonify, send_from_directory, request, redirect, url_for, session, render_template
# from werkzeug.security import check_password_hash
# import database # Imports the database.py you created earlier
# # --- Path Configurations ---
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# FRONTEND_DIR = os.path.join(BASE_DIR, '..', 'frontend')
# # Use os.path.join exclusively for cross-platform safety
# YML_PATH = os.path.join(BASE_DIR, '..', 'mxpic', 'PDKs', 'Silterra', 'directories.yaml')
# COMPS_ROOT = os.path.join(BASE_DIR, '..', 'mxpic', 'PDKs', 'Silterra')
# # Initialize Flask, pointing to the frontend folder for HTML/CSS/JS
# app = Flask(__name__, template_folder=FRONTEND_DIR, static_folder=FRONTEND_DIR)
# app.secret_key = 'super_secret_mxpic_key' # Required for session management
# app.json.sort_keys = False # Keep dictionary order
# # Ensure database tables exist when the server boots
# database.init_db()
# # --- YAML & PDK Parsing Helper Functions (Unchanged) ---
# def countSpaces(line):
# """Count leading spaces (tab=4)."""
# expanded = line.expandtabs(4)
# return len(expanded) - len(expanded.lstrip(' '))
# def buildTree(filepath):
# """Build nested tree from indented yaml."""
# if not os.path.exists(filepath):
# return OrderedDict()
# with open(filepath, 'r', encoding='utf-8') as f:
# lines = f.readlines()
# rootIdx = None
# for i, line in enumerate(lines):
# if line.strip().startswith('root') and ':' in line.strip():
# rootIdx = i
# break
# if rootIdx is None:
# return OrderedDict()
# entries = []
# for line in lines[rootIdx + 1:]:
# stripped = line.strip()
# if not stripped or stripped.startswith('#'):
# continue
# if stripped.startswith('- '):
# spaceNum = countSpaces(line)
# # FIX 1: Strip trailing colons off the string so 'composites:' becomes 'composites'
# name = stripped[2:].strip().rstrip(':')
# if name:
# entries.append((spaceNum, name))
# if not entries:
# return OrderedDict()
# minIndent = min(indent for indent, _ in entries)
# nest = OrderedDict()
# levelStack = [(minIndent - 1, nest)]
# for spaceNum, name in entries:
# while levelStack and levelStack[-1][0] >= spaceNum:
# levelStack.pop()
# parent = levelStack[-1][1]
# child = OrderedDict()
# parent[name] = child
# levelStack.append((spaceNum, child))
# return nest
# def addCompsToTree(compMap):
# """
# Build a completely fresh tree from scratch and insert component nodes.
# No previous tree object or inspection required.
# """
# # Initialize a clean, empty root tree
# fresh_tree = OrderedDict()
# for pathSeg, compItem in compMap.items():
# compName = compItem['folder']
# curNode = fresh_tree
# # Sequentially build the nested path segments dynamically
# for seg in pathSeg:
# if seg not in curNode:
# curNode[seg] = OrderedDict()
# curNode = curNode[seg]
# # Place the component metadata dictionary into its leaf node
# curNode[compName] = OrderedDict({
# "__type__": "component",
# "__name__": compName,
# "__yml__": compItem['yml']
# })
# return fresh_tree
import os
import yaml
@@ -105,6 +5,7 @@ from collections import OrderedDict
from flask import Flask, jsonify, send_from_directory, request, redirect, url_for, session, render_template
from werkzeug.security import check_password_hash
import database
from flask import Response
# --- Path Configurations ---
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -115,6 +16,10 @@ COMPS_ROOT = os.path.join(BASE_DIR, '..', 'mxpic', 'PDKs', 'Silterra')
# Define where your new icons folder is located (adjust if it's placed elsewhere)
ICONS_DIR = os.path.join(BASE_DIR, 'icons')
#build layout save path
SAVE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'generated_layouts')
app = Flask(__name__, template_folder=FRONTEND_DIR, static_folder=FRONTEND_DIR)
app.secret_key = 'super_secret_mxpic_key'
app.json.sort_keys = False
@@ -175,18 +80,22 @@ def addCompsToTree(compMap):
@app.route('/api/icon/<category>')
def getIcon(category):
"""Serve the icon corresponding to the component category."""
# Look for an image matching the category name (e.g., edge_coupler.png)
for ext in ('.png', '.svg', '.jpg'):
icon_path = os.path.join(ICONS_DIR, f"{category}{ext}")
if os.path.exists(icon_path):
return send_from_directory(ICONS_DIR, f"{category}{ext}")
# Optional: Return a default fallback icon if the specific one is missing
fallback = os.path.join(ICONS_DIR, "default.png")
if os.path.exists(fallback):
return send_from_directory(ICONS_DIR, "default.png")
return jsonify({"error": "Icon not found"}), 404
# return png if not found
transparent_png = (
b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01'
b'\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\nIDATx\x9cc\x00\x01'
b'\x00\x00\x05\x00\x01\r\n\xf4\xc0\x00\x00\x00\x00IEND\xaeB`\x82'
)
return Response(transparent_png, mimetype='image/png')
# ... [Keep existing API routes below] ...
@@ -249,6 +158,33 @@ def logout():
session.clear()
return redirect(url_for('home'))
@app.route('/api/save-layout', methods=['POST'])
def save_layout():
try:
data = request.get_json()
filename = data.get('filename', 'layout.yaml')
content = data.get('content', '')
os.makedirs(SAVE_DIR, exist_ok=True)
save_path = os.path.join(SAVE_DIR, filename)
with open(save_path, 'w', encoding='utf-8') as f:
f.write(content)
return jsonify({
"message": "successfully saved",
"path": save_path
}), 200
except Exception as e:
return jsonify({"error": str(e)}), 500
# --- API ROUTES (Library & Components) ---
@app.route('/api/library')
def getLib():
@@ -284,4 +220,8 @@ def getCompImg(component_name):
if __name__ == '__main__':
print("Starting mxpic EDA Server on http://127.0.0.1:3000")
app.run(host='127.0.0.1', port=3000, debug=True)
app.run(host='127.0.0.1', port=3000, debug=True)