Skip to content

Commit

Permalink
xrd2geom: handle some more versal insanity
Browse files Browse the repository at this point in the history
  • Loading branch information
wanda-phi committed Dec 6, 2024
1 parent 46a8036 commit 96426ef
Show file tree
Hide file tree
Showing 9 changed files with 1,473 additions and 277 deletions.
85 changes: 85 additions & 0 deletions prjcombine_rawdump/src/bin/dump_noc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ fn main() -> Result<(), Box<dyn Error>> {
&["AIE_NOC_TO_NOC"],
&["AIE_NOC_FROM_NOC"],
),
// AI-ML2
(
"AIE2P_S_INTF_C_CORE",
&[
"AIE_NOC_0_TO_NOC",
"AIE_NMU_ARBIT_TO_NOC_0",
"AIE_NMU_ARBIT_TO_NOC_1",
],
&["AIE_NOC_0_FROM_NOC"],
),
// top XPIO
(
"DDRMC_DMC_CORE_MX",
Expand Down Expand Up @@ -740,6 +750,44 @@ fn main() -> Result<(), Box<dyn Error>> {
"NOC2_XBR4X2_ATOM_0_IN_DMC_1",
],
),
(
"NOC2_NPS6X_TOP",
&[
"NOC2_NPS6X_ATOM_0_OUT_0",
"NOC2_NPS6X_ATOM_0_OUT_1",
"NOC2_NPS6X_ATOM_0_OUT_2",
"NOC2_NPS6X_ATOM_0_OUT_3",
"NOC2_NPS6X_ATOM_0_OUT_4",
"NOC2_NPS6X_ATOM_0_OUT_5",
],
&[
"NOC2_NPS6X_ATOM_0_IN_0",
"NOC2_NPS6X_ATOM_0_IN_1",
"NOC2_NPS6X_ATOM_0_IN_2",
"NOC2_NPS6X_ATOM_0_IN_3",
"NOC2_NPS6X_ATOM_0_IN_4",
"NOC2_NPS6X_ATOM_0_IN_5",
],
),
(
"NOC2_NPS6X_TOP_MX",
&[
"NOC2_NPS6X_ATOM_0_OUT_0",
"NOC2_NPS6X_ATOM_0_OUT_1",
"NOC2_NPS6X_ATOM_0_OUT_2",
"NOC2_NPS6X_ATOM_0_OUT_3",
"NOC2_NPS6X_ATOM_0_OUT_4",
"NOC2_NPS6X_ATOM_0_OUT_5",
],
&[
"NOC2_NPS6X_ATOM_0_IN_0",
"NOC2_NPS6X_ATOM_0_IN_1",
"NOC2_NPS6X_ATOM_0_IN_2",
"NOC2_NPS6X_ATOM_0_IN_3",
"NOC2_NPS6X_ATOM_0_IN_4",
"NOC2_NPS6X_ATOM_0_IN_5",
],
),
(
"NOC2_NCRB_TILE",
&[
Expand Down Expand Up @@ -771,6 +819,11 @@ fn main() -> Result<(), Box<dyn Error>> {
&["NOC2_NMU128_ATOM_0_TO_NOC"],
&["NOC2_NMU128_ATOM_0_FROM_NOC", "NOC2_NMU128_ATOM_0_AXI_IN"],
),
(
"NOC2_NMU128_TOP_MX",
&["NOC2_NMU128_ATOM_0_TO_NOC"],
&["NOC2_NMU128_ATOM_0_FROM_NOC", "NOC2_NMU128_ATOM_0_AXI_IN"],
),
(
"NOC2_NMU128_TOP_MY",
&["NOC2_NMU128_ATOM_0_TO_NOC"],
Expand All @@ -796,11 +849,21 @@ fn main() -> Result<(), Box<dyn Error>> {
&["NOC2_NMU512_ATOM_0_TO_NOC"],
&["NOC2_NMU512_ATOM_0_FROM_NOC"],
),
(
"NOC2_NMU512_VNOC4_TILE",
&["NOC2_NMU512_ATOM_0_TO_NOC"],
&["NOC2_NMU512_ATOM_0_FROM_NOC"],
),
(
"NOC2_NSU128_TOP",
&["NOC2_NSU128_ATOM_0_TO_NOC", "NOC2_NSU128_ATOM_0_AXI_OUT"],
&["NOC2_NSU128_ATOM_0_FROM_NOC"],
),
(
"NOC2_NSU128_TOP_MX",
&["NOC2_NSU128_ATOM_0_TO_NOC", "NOC2_NSU128_ATOM_0_AXI_OUT"],
&["NOC2_NSU128_ATOM_0_FROM_NOC"],
),
(
"NOC2_NSU256_TOP",
&["NOC2_NSU256_ATOM_0_TO_NOC", "NOC2_NSU256_ATOM_0_AXI_OUT"],
Expand All @@ -816,6 +879,11 @@ fn main() -> Result<(), Box<dyn Error>> {
&["NOC2_NSU512_ATOM_0_TO_NOC"],
&["NOC2_NSU512_ATOM_0_FROM_NOC"],
),
(
"NOC2_NSU512_VNOC4_TILE",
&["NOC2_NSU512_ATOM_0_TO_NOC"],
&["NOC2_NSU512_ATOM_0_FROM_NOC"],
),
// PSXL
(
"PSXL_CORE",
Expand Down Expand Up @@ -906,6 +974,23 @@ fn main() -> Result<(), Box<dyn Error>> {
"HNICX_ATOM_0_HNICX_NOC_AXIS_S3",
],
),
// ISP2
(
"ISP2_CORE",
&["ISP2_ATOM_0_NMU_ISP_0", "ISP2_ATOM_0_NMU_ISP_1"],
&["ISP2_ATOM_0_NSU_ISP"],
),
// VCU2
(
"VCU2_TILE",
&[
"VCU2_ATOM_0_NMU_VCU2_0",
"VCU2_ATOM_0_NMU_VCU2_1",
"VCU2_ATOM_0_NMU_VCU2_2",
"VCU2_ATOM_0_NMU_VCU2_3",
],
&["VCU2_ATOM_0_NSU_VCU2"],
),
] {
for &crd in rd.tiles_by_kind_name(tkn) {
let tile = &rd.tiles[&crd];
Expand Down
2 changes: 2 additions & 0 deletions prjcombine_rawdump/src/bin/rd2html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3980,6 +3980,8 @@ fn main() -> Result<(), Box<dyn Error>> {
td._rpad { padding: 5px; padding-right:1000px; border: none; position: relative; }
td._bpad { padding: 5px; padding-bottom:1000px; border: none; position: relative; }
td._unk { animation: unknown 1s infinite; }
td.NULL { border: none; }
td.PCIE_NULL { border: none; }
@keyframes unknown {
0% { background: white; }
50% { background: red; }
Expand Down
2 changes: 1 addition & 1 deletion prjcombine_ultrascale_rd2db/src/int_u.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn make_int_db(rd: &Part, dev_naming: &DeviceNaming) -> (IntDb, NamingDb) {
let mut builder = IntBuilder::new(rd);

builder.wire("VCC", WireKind::Tie1, &["VCC_WIRE"]);
builder.wire("GND", WireKind::Tie1, &["GND_WIRE"]);
builder.wire("GND", WireKind::Tie0, &["GND_WIRE"]);

for i in 0..16 {
builder.wire(
Expand Down
48 changes: 30 additions & 18 deletions prjcombine_versal/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use std::collections::BTreeSet;
use unnamed_entity::{EntityId, EntityVec};

use crate::expanded::ExpandedDevice;
use crate::grid::{
ColumnKind, CpmKind, DisabledPart, Grid, HardRowKind, Interposer, PsKind, RightKind,
};
use crate::grid::{ColumnKind, DisabledPart, Grid, HardRowKind, Interposer, RightKind};

struct DieInfo {
col_cfrm: ColId,
Expand All @@ -24,21 +22,14 @@ impl Expander<'_> {
fn fill_die(&mut self) {
for (_, &grid) in &self.grids {
self.egrid.add_die(grid.columns.len(), grid.regs * 48);
let ps_height = match (grid.ps, grid.cpm) {
(PsKind::Ps9, CpmKind::None) => 48 * 2,
(PsKind::Ps9, CpmKind::Cpm4) => 48 * 3,
(PsKind::Ps9, CpmKind::Cpm5) => 48 * 6,
(PsKind::PsX, CpmKind::Cpm5N) => 48 * 9,
_ => unreachable!(),
};
self.die.push(DieInfo {
col_cfrm: grid
.columns
.iter()
.find(|(_, cd)| cd.l == ColumnKind::Cfrm)
.unwrap()
.0,
ps_height,
ps_height: grid.get_ps_height(),
});
}
}
Expand Down Expand Up @@ -308,8 +299,16 @@ impl Expander<'_> {
if tile.nodes.is_empty() {
continue;
}
die.add_xnode((col, row), "CLE_R", &[(col, row)]);
die.add_xnode((col + 1, row), "CLE_L", &[(col + 1, row)]);
die.add_xnode(
(col, row),
if grid.is_vr { "CLE_R.VR" } else { "CLE_R" },
&[(col, row)],
);
die.add_xnode(
(col + 1, row),
if grid.is_vr { "CLE_L.VR" } else { "CLE_L" },
&[(col + 1, row)],
);
}
}
}
Expand Down Expand Up @@ -451,6 +450,9 @@ impl Expander<'_> {
HardRowKind::DcmacB => ("DCMAC", true),
HardRowKind::IlknB => ("ILKN", true),
HardRowKind::HscB => ("HSC", true),
HardRowKind::SdfecA => ("SDFEC", false),
HardRowKind::DfeCfcB => ("DFE_CFC_BOT", false),
HardRowKind::DfeCfcT => ("DFE_CFC_TOP", false),
};
let row = grid.row_reg_bot(reg);
let mut crd = vec![];
Expand All @@ -471,7 +473,10 @@ impl Expander<'_> {
for (dieid, grid) in &self.grids {
let mut die = self.egrid.die_mut(dieid);
for (col, cd) in &grid.columns {
if !matches!(cd.l, ColumnKind::VNoc | ColumnKind::VNoc2) {
if !matches!(
cd.l,
ColumnKind::VNoc | ColumnKind::VNoc2 | ColumnKind::VNoc4
) {
continue;
}
if self.disabled.contains(&DisabledPart::Column(die.die, col)) {
Expand All @@ -489,10 +494,17 @@ impl Expander<'_> {
for i in 0..48 {
crd.push((col, row + i));
}
if cd.l == ColumnKind::VNoc {
die.add_xnode((col, row), "VNOC", &crd);
} else {
die.add_xnode((col, row), "VNOC2", &crd);
match cd.l {
ColumnKind::VNoc => {
die.add_xnode((col, row), "VNOC", &crd);
}
ColumnKind::VNoc2 => {
die.add_xnode((col, row), "VNOC2", &crd);
}
ColumnKind::VNoc4 => {
die.add_xnode((col, row), "VNOC4", &crd);
}
_ => unreachable!(),
}
if grid.is_reg_top(reg) {
die.add_xnode((col, row), "MISR", &crd);
Expand Down
30 changes: 30 additions & 0 deletions prjcombine_versal/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct Grid {
pub ps: PsKind,
pub cpm: CpmKind,
pub has_xram_top: bool,
pub is_vr: bool,
pub top: TopKind,
pub bottom: BotKind,
pub right: RightKind,
Expand Down Expand Up @@ -57,6 +58,7 @@ pub enum BramKind {
Plain,
ClkBuf,
ClkBufNoPd,
MaybeClkBufNoPd,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
Expand All @@ -70,6 +72,7 @@ pub enum ColumnKind {
Cfrm,
VNoc,
VNoc2,
VNoc4,
None,
}

Expand All @@ -83,6 +86,7 @@ pub enum ColSide {
pub enum PsKind {
Ps9,
PsX,
PsXc,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
Expand All @@ -100,6 +104,9 @@ pub enum HardRowKind {
Pcie4,
Pcie5,
Mrmac,
SdfecA,
DfeCfcB,
DfeCfcT,
IlknB,
IlknT,
DcmacB,
Expand All @@ -121,9 +128,14 @@ pub enum GtRowKind {
Gty,
Gtyp,
Gtm,
RfAdc,
RfDac,
Xram,
Vdu,
BfrB,
Isp2,
Vcu2B,
Vcu2T,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
Expand Down Expand Up @@ -197,6 +209,17 @@ impl Grid {
pub fn get_col_hard(&self, col: ColId) -> Option<&HardColumn> {
self.cols_hard.iter().find(|x| x.col == col)
}

pub fn get_ps_height(&self) -> usize {
match (self.ps, self.cpm) {
(PsKind::Ps9, CpmKind::None) => 48 * 2,
(PsKind::Ps9, CpmKind::Cpm4) => 48 * 3,
(PsKind::Ps9, CpmKind::Cpm5) => 48 * 6,
(PsKind::PsX, CpmKind::Cpm5N) => 48 * 9,
(PsKind::PsXc, CpmKind::None) => 48 * 6,
_ => unreachable!(),
}
}
}

impl std::fmt::Display for Grid {
Expand All @@ -205,6 +228,7 @@ impl std::fmt::Display for Grid {
writeln!(f, "\tPS: {v:?}", v = self.ps)?;
writeln!(f, "\tCPM: {v:?}", v = self.cpm)?;
writeln!(f, "\tXRAM TOP: {v:?}", v = self.has_xram_top)?;
writeln!(f, "\tIS VR: {v:?}", v = self.is_vr)?;
writeln!(f, "\tTOP: {v:?}", v = self.top)?;
writeln!(f, "\tBOTTOM: {v:?}", v = self.bottom)?;
writeln!(f, "\tCOLS:")?;
Expand All @@ -222,6 +246,7 @@ impl std::fmt::Display for Grid {
| ColumnKind::Hard
| ColumnKind::VNoc
| ColumnKind::VNoc2
| ColumnKind::VNoc4
) {
write!(f, "\t\tX{cl}.R-X{col}.L: ", cl = col - 1)?;
} else {
Expand All @@ -236,12 +261,14 @@ impl std::fmt::Display for Grid {
ColumnKind::Bram(BramKind::Plain) => write!(f, "BRAM")?,
ColumnKind::Bram(BramKind::ClkBuf) => write!(f, "BRAM.CLKBUF")?,
ColumnKind::Bram(BramKind::ClkBufNoPd) => write!(f, "BRAM.CLKBUF.NOPD")?,
ColumnKind::Bram(BramKind::MaybeClkBufNoPd) => write!(f, "BRAM.MAYBE.CLKBUF.NOPD")?,
ColumnKind::Uram => write!(f, "URAM")?,
ColumnKind::Hard => write!(f, "HARD")?,
ColumnKind::Gt => write!(f, "GT")?,
ColumnKind::Cfrm => write!(f, "CFRM")?,
ColumnKind::VNoc => write!(f, "VNOC")?,
ColumnKind::VNoc2 => write!(f, "VNOC2")?,
ColumnKind::VNoc4 => write!(f, "VNOC4")?,
}
if cd.has_bli_bot_l {
write!(f, " BLI.BOT")?;
Expand All @@ -264,6 +291,7 @@ impl std::fmt::Display for Grid {
| ColumnKind::Hard
| ColumnKind::VNoc
| ColumnKind::VNoc2
| ColumnKind::VNoc4
) {
continue;
}
Expand All @@ -277,12 +305,14 @@ impl std::fmt::Display for Grid {
ColumnKind::Bram(BramKind::Plain) => write!(f, "BRAM")?,
ColumnKind::Bram(BramKind::ClkBuf) => write!(f, "BRAM.CLKBUF")?,
ColumnKind::Bram(BramKind::ClkBufNoPd) => write!(f, "BRAM.CLKBUF.NOPD")?,
ColumnKind::Bram(BramKind::MaybeClkBufNoPd) => write!(f, "BRAM.MAYBE.CLKBUF.NOPD")?,
ColumnKind::Uram => write!(f, "URAM")?,
ColumnKind::Hard => write!(f, "HARD")?,
ColumnKind::Gt => write!(f, "GT")?,
ColumnKind::Cfrm => write!(f, "CFRM")?,
ColumnKind::VNoc => write!(f, "VNOC")?,
ColumnKind::VNoc2 => write!(f, "VNOC2")?,
ColumnKind::VNoc4 => write!(f, "VNOC4")?,
}
if cd.has_bli_bot_r {
write!(f, " BLI.BOT")?;
Expand Down
Loading

0 comments on commit 96426ef

Please sign in to comment.