Skip to content

Commit

Permalink
ise_hammer: 6s IOB.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanda-phi committed Oct 13, 2024
1 parent 5e92b60 commit 9f31943
Show file tree
Hide file tree
Showing 19 changed files with 1,775 additions and 208 deletions.
2 changes: 1 addition & 1 deletion databases/xc6s-tiledb.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/gen_xilinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ def emit_dev_table_string(f, name):
f.write(f"</table>")

if kind == "xc6s":
emit_misc_table("xilinx/gen/xc6s-iostd-drive.html", "IOSTD:PDRIVE", "IOSTD:NDRIVE")
emit_misc_table("xilinx/gen/xc6s-iostd-term.html", "IOSTD:PTERM", "IOSTD:NTERM")
emit_misc_table("xilinx/gen/xc6s-iostd-slew.html", "IOSTD:PSLEW", "IOSTD:NSLEW")
emit_misc_table("xilinx/gen/xc6s-iostd-lvdsbias.html", "IOSTD:LVDSBIAS")

with open("xilinx/gen/xc6s-pci-ce-delay.html", "w") as f:
emit_dev_table_string(f, "PCI_CE_DELAY")
emit_misc_table("xilinx/gen/xc6s-pll-lock.html",
Expand Down
22 changes: 22 additions & 0 deletions docs/xilinx/spartan6/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,25 @@ Bitstream — ``IOI.BT``
.. raw:: html
:file: ../gen/tile-xc6s-IOI.BT.html


Bitstream — ``IOB``
===================

.. raw:: html
:file: ../gen/tile-xc6s-IOB.html


Tables
======

.. raw:: html
:file: ../gen/xc6s-iostd-drive.html

.. raw:: html
:file: ../gen/xc6s-iostd-term.html

.. raw:: html
:file: ../gen/xc6s-iostd-slew.html

.. raw:: html
:file: ../gen/xc6s-iostd-lvdsbias.html
2 changes: 1 addition & 1 deletion prjcombine_int/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ pub struct NodePip {
pub node_wire_in: NodeWireId,
}

impl<'a> ExpandedGrid<'a> {
impl ExpandedGrid<'_> {
pub fn resolve_wire_raw(&self, mut wire: IntWire) -> Option<IntWire> {
let die = self.die(wire.0);
loop {
Expand Down
4 changes: 2 additions & 2 deletions prjcombine_ise_hammer/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct IseBackend<'a> {
pub ebonds: &'a HashMap<String, ExpandedBond<'a>>,
}

impl<'a> std::fmt::Debug for IseBackend<'a> {
impl std::fmt::Debug for IseBackend<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IseBackend")
.field("device", &self.device)
Expand Down Expand Up @@ -277,7 +277,7 @@ impl State {
}
}

impl<'a> IseBackend<'a> {
impl IseBackend<'_> {
fn gen_key(&self, gopts: &mut HashMap<String, String>) -> KeyData {
let mut rng = thread_rng();
match self.edev {
Expand Down
66 changes: 64 additions & 2 deletions prjcombine_ise_hammer/src/fgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ pub enum BelKV {
RowMutexHere(String),
Mutex(String, String),
IsBonded,
IsBank(u32),
IsDiff,
IsVref,
IsVr,
Expand Down Expand Up @@ -2589,7 +2590,17 @@ impl<'a> BelKV {
fuzzer
}
ExpandedBond::Virtex2(_) => todo!(),
ExpandedBond::Spartan6(_) => todo!(),
ExpandedBond::Spartan6(ebond) => {
let crd = prjcombine_spartan6::grid::IoCoord {
col: loc.1,
row: loc.2,
iob: prjcombine_spartan6::grid::TileIobId::from_idx(bel.to_idx()),
};
if !ebond.ios.contains_key(&crd) {
return None;
}
fuzzer
}
ExpandedBond::Virtex4(ebond) => {
let node = backend.egrid.node(loc);
let ExpandedDevice::Virtex4(edev) = backend.edev else {
Expand All @@ -2616,6 +2627,20 @@ impl<'a> BelKV {
ExpandedBond::Versal(_) => todo!(),
}
}
BelKV::IsBank(bank) => match backend.edev {
ExpandedDevice::Spartan6(edev) => {
let crd = prjcombine_spartan6::grid::IoCoord {
col: loc.1,
row: loc.2,
iob: prjcombine_spartan6::grid::TileIobId::from_idx(bel.to_idx()),
};
if edev.io_by_coord[&crd].bank != *bank {
return None;
}
fuzzer
}
_ => todo!(),
},
BelKV::IsDiff => {
let FuzzerValue::Base(Value::String(pkg)) = &fuzzer.kv[&Key::Package] else {
unreachable!()
Expand Down Expand Up @@ -2670,7 +2695,17 @@ impl<'a> BelKV {
}
fuzzer
}
ExpandedBond::Spartan6(_) => todo!(),
ExpandedBond::Spartan6(ebond) => {
let crd = prjcombine_spartan6::grid::IoCoord {
col: loc.1,
row: loc.2,
iob: prjcombine_spartan6::grid::TileIobId::from_idx(bel.to_idx()),
};
if !ebond.bond.vref.contains(&crd) {
return None;
}
fuzzer
}
ExpandedBond::Virtex4(ebond) => {
let node = backend.egrid.node(loc);
let ExpandedDevice::Virtex4(edev) = backend.edev else {
Expand Down Expand Up @@ -3870,6 +3905,7 @@ pub enum TileBits {
DoubleHclk,
GtpCommonMid,
GtpChannelMid,
IobS6,
}

impl TileBits {
Expand Down Expand Up @@ -4492,13 +4528,20 @@ impl TileBits {
.map(|i| edev.btile_main(loc.0, col, loc.2 + i))
.collect()
}
TileBits::IobS6 => {
let ExpandedDevice::Spartan6(edev) = backend.edev else {
unreachable!()
};
vec![edev.btile_iob(loc.1, loc.2)]
}
}
}
}

#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum ExtraFeatureKind {
MainFixed(ColId, RowId),
MainFixedPair(ColId, RowId),
Corner(ColId, RowId),
AllDcms,
AllOtherDcms,
Expand Down Expand Up @@ -4552,6 +4595,7 @@ pub enum ExtraFeatureKind {
HclkIoiHere(NodeKindId),
AllBankIo,
AllMcbIoi,
IoiHere,
}

impl ExtraFeatureKind {
Expand All @@ -4564,6 +4608,18 @@ impl ExtraFeatureKind {
ExpandedDevice::Virtex2(edev) => {
vec![vec![edev.btile_main(col, row)]]
}
ExpandedDevice::Spartan6(edev) => {
vec![vec![edev.btile_main(col, row)]]
}
_ => todo!(),
},
ExtraFeatureKind::MainFixedPair(col, row) => match backend.edev {
ExpandedDevice::Spartan6(edev) => {
vec![vec![
edev.btile_main(col, row),
edev.btile_main(col, row + 1),
]]
}
_ => todo!(),
},
ExtraFeatureKind::Corner(col, row) => match backend.edev {
Expand Down Expand Up @@ -5653,6 +5709,12 @@ impl ExtraFeatureKind {
}
res
}
ExtraFeatureKind::IoiHere => {
let ExpandedDevice::Spartan6(edev) = backend.edev else {
unreachable!()
};
vec![vec![edev.btile_main(loc.1, loc.2)]]
}
}
}
}
Expand Down
48 changes: 48 additions & 0 deletions prjcombine_ise_hammer/src/io/iostd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ impl Iostd {
}
}

pub const fn cmos_od(name: &'static str) -> Iostd {
Iostd {
name,
vcco: None,
vref: None,
diff: DiffKind::None,
dci: DciKind::None,
drive: &[],
input_only: false,
}
}

pub const fn odci(name: &'static str, vcco: u16) -> Iostd {
Iostd {
name,
Expand Down Expand Up @@ -102,6 +114,18 @@ impl Iostd {
}
}

pub const fn vref_input(name: &'static str, vcco: u16, vref: u16) -> Iostd {
Iostd {
name,
vcco: Some(vcco),
vref: Some(vref),
diff: DiffKind::None,
dci: DciKind::None,
drive: &[],
input_only: true,
}
}

pub const fn vref_dci_od(name: &'static str, vcco: u16, vref: u16) -> Iostd {
Iostd {
name,
Expand Down Expand Up @@ -185,4 +209,28 @@ impl Iostd {
input_only: false,
}
}

pub const fn diff_input(name: &'static str, vcco: u16) -> Iostd {
Iostd {
name,
vcco: Some(vcco),
vref: None,
diff: DiffKind::Pseudo,
dci: DciKind::None,
drive: &[],
input_only: true,
}
}

pub const fn true_diff_input(name: &'static str, vcco: u16) -> Iostd {
Iostd {
name,
vcco: Some(vcco),
vref: None,
diff: DiffKind::True,
dci: DciKind::None,
drive: &[],
input_only: true,
}
}
}
Loading

0 comments on commit 9f31943

Please sign in to comment.