ShiboSoftwareDev/am69-cm5

A 55×40 mm 10-layer CM5 carrier board integrating an AM69A98 SoC, 8‑GiB LPDDR4, 32‑GB eMMC, CM5 connectors, clocking, extensive decoupling/EMI filtering, and HDI DDR/ground escape routing.

Version
0.0.7-engineering-draft-20261107-manual-ddr0
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone ShiboSoftwareDev/am69-cm5  # download the package files into ./am69-cm5
tsci add ShiboSoftwareDev/am69-cm5    # add it to your project as @tsci/ShiboSoftwareDev.am69-cm5

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

components/shared/core/ReferenceCore.tsx

import { AM69A98, am69a98Pads, am69a98BallToPin } from "./AM69A98"
import { MT53E2G32D4DE, mt53e2g32d4dePads, mt53e2g32d4deBallToPin } from "./MT53E2G32D4DE"
import { sourceNetToTscircuitNet } from "./ReferenceDecoupling"
import reference from "./CoreConnections.data.json"
import {uniqueNativeEscapeConnections,type NativeHdiBoard} from './NativeEscapeConnections'
import {unusedDdrNoConnectBalls} from './UnusedDdrPins'

type PinFact = { signal: string; referenceNet: string }
type Placement = { pcbX: number; pcbY: number; pcbRotation?: number; layer?: "top" | "bottom" }
export type ReferenceCoreProps = {
  cpu: Placement
  ram: Placement
  /** Explicit changes from the source design, addressed by physical ball ID. */
  cpuConnections?: Record<string, string>
  ramConnections?: Record<string, string>
  netOverrides?: Record<string, string>
  /** Native escape qualification; default off until the board-level pass is checked. */
  cpuFanout?: boolean
  viaInPadBalls?: {U28:readonly string[];U25:readonly string[]}
  nativeHdiBoard?:NativeHdiBoard
}

function connectionsFor(pins: Record<string, PinFact>, overrides: Record<string, string>, netOverrides: Record<string, string>,unconnected:ReadonlySet<string>=new Set()) {
  for (const ball of Object.keys(overrides)) {
    if (!pins[ball]) throw new Error(`Unknown physical core ball ${ball}`)
    if(unconnected.has(ball))throw new Error(`Unused DDR signal ${ball} must have no trace or escape via on the single-DDR design`)
  }
  return Object.fromEntries(Object.entries(pins).flatMap(([ball, fact]) => {
    if(unconnected.has(ball))return []
    if (Object.hasOwn(overrides, ball)) return [[ball, overrides[ball]]]
    return fact.referenceNet ? [[ball, netOverrides[fact.referenceNet] ?? `net.${sourceNetToTscircuitNet(fact.referenceNet)}`]] : []
  }))
}

function roleFor(signal: string) {
  if (signal === "VSS" || signal === "VSSQ" || signal === "VSSCA") return { requiresGround: true }
  if (/^(VDD|VDDA|VDDS)/.test(signal)) return { requiresPower: true }
  return { isPassive: true }
}

function cpuGroup(signal: string) {
  if (/^DDR[0-3]_/.test(signal)) return signal.slice(0, 4)
  if (/^(VDD|VSS|VDA|CAP_)/.test(signal)) return "POWER"
  if (/^(DSI|CSI)/.test(signal)) return "MIPI"
  if (/^(SERDES|PCIE)/.test(signal)) return "SERDES_PCIE"
  if (/^(MMC|USB)/.test(signal)) return "STORAGE_USB"
  if (/^(RSVD|RESERVED)/.test(signal)) return "RESERVED"
  return "GENERAL_IO"
}

function chunksByGroup(pads: readonly { ball: string; signal: string }[], groupFor: (signal: string) => string) {
  const groups = new Map<string, string[]>()
  for (const pad of pads) {
    const name = groupFor(pad.signal)
    const group = groups.get(name) ?? []
    group.push(pad.ball)
    groups.set(name, group)
  }
  return [...groups].flatMap(([name, balls]) => {
    const chunks = []
    for (let start = 0; start < balls.length; start += 72) {
      chunks.push({ name: `${name}_${start / 72 + 1}`, balls: balls.slice(start, start + 72) })
    }
    return chunks
  })
}

/**
 * Verified physical AM69A98 + DDRSS0 package and reference pin/net fragment.
 * Parent must supply all regulator, reset, boot, clock, interface and PDN work.
 * This is an8GiB DDR0 population. Other DDR data/command/output signals are
 * explicit NC; required DQS/CAL/RET pulls and powered supplies remain distinct.
 */
export function ReferenceCore({ cpu, ram, cpuConnections = {}, ramConnections = {}, netOverrides = {}, cpuFanout = false,viaInPadBalls,nativeHdiBoard }: ReferenceCoreProps) {
  if(cpuFanout&&viaInPadBalls)throw new Error("Select one physical CPU escape strategy")
  const cpuPins = reference.components.U28.pins
  const ramPins = reference.components.U25.pins
  const cpuGroups = chunksByGroup(am69a98Pads, cpuGroup)
  const ramGroups = chunksByGroup(mt53e2g32d4dePads, () => "LPDDR4")
  const cpuChip = <AM69A98 name="U28" {...cpu}
      viaInPadBalls={viaInPadBalls?.U28}
      noSchematicRepresentation
      connections={uniqueNativeEscapeConnections('U28',connectionsFor(cpuPins, cpuConnections, netOverrides,unusedDdrNoConnectBalls),nativeHdiBoard)}
      pinAttributes={Object.fromEntries(am69a98Pads.map(pad => [am69a98BallToPin[pad.ball], roleFor(pad.signal)]))}
      noConnect={am69a98Pads.filter(pad => /^RSVD/.test(pad.signal)||unusedDdrNoConnectBalls.has(pad.ball)).map(pad => pad.ball)} />
  return <>
    {cpuFanout ? <fanout name="CPU_ESCAPE" autorouter="dogbone" fanoutRoutingLayers={["inner2"]}>{cpuChip}</fanout> : cpuChip}
    <MT53E2G32D4DE name="U25" {...ram}
      viaInPadBalls={viaInPadBalls?.U25}
      noSchematicRepresentation
      connections={uniqueNativeEscapeConnections('U25',connectionsFor(ramPins, ramConnections, netOverrides),nativeHdiBoard)}
      pinAttributes={Object.fromEntries(mt53e2g32d4dePads.map(pad => [mt53e2g32d4deBallToPin[pad.ball], roleFor(pad.signal)]))}
      noConnect={mt53e2g32d4dePads.filter(pad => /^(DNU|NC)/.test(pad.signal)).map(pad => pad.ball)} />
    {cpuGroups.map(group => <schematicsheet sheetWidth={800} sheetHeight={600} key={group.name} name={`CPU_${group.name}`} displayName={`AM69A98 ${group.name}`}>
      <schematicbox name={`CPU_BOX_${group.name}`} chipRef=".U28" title={`AM69A98 ${group.name}`}
        pinLabels={Object.fromEntries(group.balls.map(ball => [am69a98BallToPin[ball], [ball, am69a98BallToPin[ball]]]))}
        schPinArrangement={{ leftSide: group.balls.slice(0, Math.ceil(group.balls.length / 2)), rightSide: group.balls.slice(Math.ceil(group.balls.length / 2)) }}
        width={20} height={Math.max(2, Math.ceil(group.balls.length / 2) * 0.2 + 0.4)} schX={0} schY={0} />
    </schematicsheet>)}
    {ramGroups.map(group => <schematicsheet sheetWidth={800} sheetHeight={600} key={group.name} name={`RAM_${group.name}`} displayName={`LPDDR4 ${group.name}`}>
      <schematicbox name={`RAM_BOX_${group.name}`} chipRef=".U25" title={`8 GiB LPDDR4 ${group.name}`}
        pinLabels={Object.fromEntries(group.balls.map(ball => [mt53e2g32d4deBallToPin[ball], [ball, mt53e2g32d4deBallToPin[ball]]]))}
        schPinArrangement={{ leftSide: group.balls.slice(0, Math.ceil(group.balls.length / 2)), rightSide: group.balls.slice(Math.ceil(group.balls.length / 2)) }}
        width={18} height={Math.max(2, Math.ceil(group.balls.length / 2) * 0.2 + 0.4)} schX={0} schY={0} />
    </schematicsheet>)}
  </>
}