SLSystemBus.sleela
lib/cpu/components/SLSystemBus.sleela · 97 line(s) · sleela
<< lib/cpu/components/SLSystemBus.sleela
SLeeLa Standard Library Definition.
Definition: Defines SLSystemBus — a selectable system/expansion bus for a
Sleela executor build: ISA, PCI, AGP, PCIe (by generation and lane count),
or a front-side bus. It carries the real spec that bounds how fast the CPU,
memory, and devices talk to each other: bus clock, data width, and the
resulting peak bandwidth. The bus can cap an otherwise-fast RAM/storage
choice, so it belongs in the build.
Family: cpu.components. Selected via SLComponentCatalog. >>
#sleela 2.5
material;
class SLSystemBus {
< ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
<< Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
or catalog can read and (where appropriate) override this record.
Values are faithful to the subject's real origin where publicly known. >>
String metaVersion = "1.0.0";
int metaId = 10536;
String metaAuthor = "Kiro Agent";
String metaDate = "2026-10-16";
String metaCopyright = "SLeeLa project";
String metaTrademark = "none";
String metaCorporation = "none";
< metaOrigin: National | <nation> | International | Galactic >
String metaOrigin = "International";
String metaBirthDate = "2026-10-09";
< metaScienceRating: maturity/robustness on a 1..10 scale >
int metaScienceRating = 9;
< metaNationalSchedule: a real, citable instrument or "none" >
String metaNationalSchedule = "none";
String getMetaVersion() { return metaVersion; }
void setMetaVersion(String v) { metaVersion = v; }
int getMetaId() { return metaId; }
void setMetaId(int v) { metaId = v; }
String getAuthor() { return metaAuthor; }
void setAuthor(String v) { metaAuthor = v; }
String getDate() { return metaDate; }
void setDate(String v) { metaDate = v; }
String getCopyright() { return metaCopyright; }
void setCopyright(String v) { metaCopyright = v; }
String getTrademark() { return metaTrademark; }
void setTrademark(String v) { metaTrademark = v; }
String getCorporation() { return metaCorporation; }
void setCorporation(String v) { metaCorporation = v; }
String getOrigin() { return metaOrigin; }
void setOrigin(String v) { metaOrigin = v; }
String getBirthDate() { return metaBirthDate; }
void setBirthDate(String v) { metaBirthDate = v; }
int getScienceRating() { return metaScienceRating; }
void setScienceRating(int v) { metaScienceRating = v; }
String getNationalSchedule() { return metaNationalSchedule; }
void setNationalSchedule(String v) { metaNationalSchedule = v; }
static final int BUS_ISA = 0;
static final int BUS_PCI = 1;
static final int BUS_AGP = 2;
static final int BUS_PCIE = 3;
static final int BUS_FSB = 4;
String partName;
int busType;
int clockMHz;
< data path width >
int widthBits;
< for PCIe (1 otherwise) >
int lanes;
< per-lane rate for serial buses (PCIe), 0 for parallel >
int perLaneMBs;
void configure(String name, int type, int clock, int width, int laneCount, int laneMBs) {
partName = name; busType = type; clockMHz = clock; widthBits = width;
lanes = (laneCount < 1) ? 1 : laneCount; perLaneMBs = laneMBs;
}
< Peak bandwidth in MB/s. Serial buses (PCIe) use per-lane × lanes; parallel >
< buses use clock × bus bytes. >
int peakBandwidthMBs() {
if (perLaneMBs > 0) { return perLaneMBs * lanes; }
return clockMHz * (widthBits / 8);
}
String name() { return partName; }
int clock() { return clockMHz; }
int width() { return widthBits; }
int laneCount() { return lanes; }
String busName() {
if (busType == BUS_ISA) { return "ISA"; }
if (busType == BUS_PCI) { return "PCI"; }
if (busType == BUS_AGP) { return "AGP"; }
if (busType == BUS_PCIE) { return "PCIe"; }
if (busType == BUS_FSB) { return "FSB"; }
return "bus";
}
}