Skip to content

Commit

Permalink
ise_hammer: 6v IOB.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanda-phi committed Sep 14, 2024
1 parent a913c85 commit 8cd1a50
Show file tree
Hide file tree
Showing 16 changed files with 1,860 additions and 103 deletions.
2 changes: 1 addition & 1 deletion databases/xc6v-tiledb.json

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions docs/gen_xilinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,14 @@ def emit_dev_table_string(f, name):
emit_misc_table("xilinx/gen/xc5v-iostd-dci-lvdiv2.html", "IOSTD:DCI:LVDIV2")
emit_misc_table("xilinx/gen/xc5v-iostd-dci-mask-term-vcc.html", "IOSTD:DCI:PMASK_TERM_VCC")
emit_misc_table("xilinx/gen/xc5v-iostd-dci-mask-term-split.html", "IOSTD:DCI:PMASK_TERM_SPLIT", "IOSTD:DCI:NMASK_TERM_SPLIT")

if kind == "xc6v":
emit_misc_table("xilinx/gen/xc6v-iostd-misc.html", "IOSTD:OUTPUT_MISC")
emit_misc_table("xilinx/gen/xc6v-iostd-drive.html", "IOSTD:PDRIVE", "IOSTD:NDRIVE")
emit_misc_table("xilinx/gen/xc6v-iostd-slew.html", "IOSTD:PSLEW", "IOSTD:NSLEW")
emit_misc_table("xilinx/gen/xc6v-iostd-lvds.html", "IOSTD:LVDS_T", "IOSTD:LVDS_C")
emit_misc_table("xilinx/gen/xc6v-iostd-lvdsbias.html", "IOSTD:LVDSBIAS")
emit_misc_table("xilinx/gen/xc6v-iostd-dci-output.html", "IOSTD:DCI:PREF_OUTPUT", "IOSTD:DCI:NREF_OUTPUT")
emit_misc_table("xilinx/gen/xc6v-iostd-dci-output-half.html", "IOSTD:DCI:PREF_OUTPUT_HALF", "IOSTD:DCI:NREF_OUTPUT_HALF")
emit_misc_table("xilinx/gen/xc6v-iostd-dci-term-vcc.html", "IOSTD:DCI:PREF_TERM_VCC", "IOSTD:DCI:PMASK_TERM_VCC")
emit_misc_table("xilinx/gen/xc6v-iostd-dci-term-split.html", "IOSTD:DCI:PREF_TERM_SPLIT", "IOSTD:DCI:NREF_TERM_SPLIT", "IOSTD:DCI:PMASK_TERM_SPLIT", "IOSTD:DCI:NMASK_TERM_SPLIT")
7 changes: 0 additions & 7 deletions docs/xilinx/virtex6/center.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,3 @@ Bitstream

.. raw:: html
:file: ../gen/tile-xc6v-CFG.html


Bitstream — PMVIOB
==================

.. raw:: html
:file: ../gen/tile-xc6v-PMVIOB.html
20 changes: 20 additions & 0 deletions docs/xilinx/virtex6/clock.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _virtex6-clock:

Clock interconnect
##################

.. todo:: describe this madness


``HCLK``
========

.. raw:: html
:file: ../gen/tile-xc6v-HCLK.html


``PMVIOB``
==========

.. raw:: html
:file: ../gen/tile-xc6v-PMVIOB.html
1 change: 1 addition & 0 deletions docs/xilinx/virtex6/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Virtex 6
dsp
io
center
clock
emac
pcie
gtx
Expand Down
38 changes: 36 additions & 2 deletions docs/xilinx/virtex6/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,42 @@ The devices also have dedicated configuration bank 0, which has no user I/O and
- ``TCK``, ``TDI``, ``TDO``, ``TMS``


Bitstream
=========
Bitstream — ``IO``
==================

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

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

.. raw:: html
:file: ../gen/xc6v-iostd-misc.html

.. raw:: html
:file: ../gen/xc6v-iostd-lvds.html

.. raw:: html
:file: ../gen/tile-xc6v-IO.html


Bitstream — ``HCLK_IOI``
========================

.. raw:: html
:file: ../gen/xc6v-iostd-lvdsbias.html

.. raw:: html
:file: ../gen/xc6v-iostd-dci-output.html

.. raw:: html
:file: ../gen/xc6v-iostd-dci-output-half.html

.. raw:: html
:file: ../gen/xc6v-iostd-dci-term-vcc.html

.. raw:: html
:file: ../gen/xc6v-iostd-dci-term-split.html

.. raw:: html
:file: ../gen/tile-xc6v-HCLK_IOI.html
1 change: 1 addition & 0 deletions prjcombine_ise_hammer/src/clk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pub mod virtex;
pub mod virtex2;
pub mod virtex4;
pub mod virtex5;
pub mod virtex6;
123 changes: 123 additions & 0 deletions prjcombine_ise_hammer/src/clk/virtex6.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
use prjcombine_hammer::Session;

use crate::{
backend::IseBackend,
diff::{xlat_bit, xlat_enum_ocd, CollectorCtx, Diff, OcdMode},
fgen::{BelRelation, TileBits},
fuzz::FuzzCtx,
fuzz_enum, fuzz_one,
};

pub fn add_fuzzers<'a>(session: &mut Session<IseBackend<'a>>, backend: &IseBackend<'a>) {
{
let ctx = FuzzCtx::new(session, backend, "HCLK", "HCLK", TileBits::Hclk);
for i in 0..8 {
for ud in ['U', 'D'] {
for j in 0..12 {
fuzz_one!(ctx, format!("MUX.OUT_{ud}{i}"), format!("HCLK{j}"), [
(global_mutex "BUFH_TEST", format!("USED_HCLK{j}")),
(pip
(related_pin BelRelation::Rclk, format!("HCLK{j}_L_I")),
(related_pin BelRelation::Rclk, "BUFH_TEST_L_PRE")),
(pip
(related_pin BelRelation::Rclk, format!("HCLK{j}_R_I")),
(related_pin BelRelation::Rclk, "BUFH_TEST_R_PRE")),
(mutex format!("MUX.OUT_{ud}{i}"), format!("HCLK{j}")),
(mutex format!("HCLK{j}"), format!("MUX.OUT_{ud}{i}"))
], [
(pip (pin format!("HCLK{j}")), (pin format!("OUT_{ud}{i}")))
]);
}
for j in 0..6 {
fuzz_one!(ctx, format!("MUX.OUT_{ud}{i}"), format!("RCLK{j}"), [
(global_mutex "BUFH_TEST", format!("USED_RCLK{j}")),
(pip
(related_pin BelRelation::Rclk, format!("RCLK{j}_L_I")),
(related_pin BelRelation::Rclk, "BUFH_TEST_L_PRE")),
(pip
(related_pin BelRelation::Rclk, format!("RCLK{j}_R_I")),
(related_pin BelRelation::Rclk, "BUFH_TEST_R_PRE")),
(mutex format!("MUX.OUT_{ud}{i}"), format!("RCLK{j}")),
(mutex format!("RCLK{j}"), format!("MUX.OUT_{ud}{i}"))
], [
(pip (pin format!("RCLK{j}")), (pin format!("OUT_{ud}{i}")))
]);
}
}
}
}

{
let ctx = FuzzCtx::new(session, backend, "PMVIOB", "PMVIOB", TileBits::MainAuto);
fuzz_one!(ctx, "PRESENT", "1", [], [(mode "PMVIOB")]);
fuzz_enum!(ctx, "HSLEW4_IN", ["FALSE", "TRUE"], [(mode "PMVIOB")]);
fuzz_enum!(ctx, "PSLEW4_IN", ["FALSE", "TRUE"], [(mode "PMVIOB")]);
fuzz_enum!(ctx, "HYS_IN", ["FALSE", "TRUE"], [(mode "PMVIOB")]);
}
}

pub fn collect_fuzzers(ctx: &mut CollectorCtx) {
{
let tile = "HCLK";
let bel = "HCLK";
for i in 0..12 {
let (_, _, diff) = Diff::split(
ctx.state
.peek_diff(tile, bel, "MUX.OUT_D0", format!("HCLK{i}"))
.clone(),
ctx.state
.peek_diff(tile, bel, "MUX.OUT_U0", format!("HCLK{i}"))
.clone(),
);
ctx.tiledb
.insert(tile, bel, format!("ENABLE.HCLK{i}"), xlat_bit(diff));
}
for i in 0..6 {
let (_, _, diff) = Diff::split(
ctx.state
.peek_diff(tile, bel, "MUX.OUT_D0", format!("RCLK{i}"))
.clone(),
ctx.state
.peek_diff(tile, bel, "MUX.OUT_U0", format!("RCLK{i}"))
.clone(),
);
ctx.tiledb
.insert(tile, bel, format!("ENABLE.RCLK{i}"), xlat_bit(diff));
}
for i in 0..8 {
for ud in ['U', 'D'] {
let mux = &format!("MUX.OUT_{ud}{i}");
let mut diffs = vec![("NONE".to_string(), Diff::default())];
for i in 0..12 {
let val = format!("HCLK{i}");
let mut diff = ctx.state.get_diff(tile, bel, mux, &val);
diff.apply_bit_diff(
ctx.tiledb.item(tile, bel, &format!("ENABLE.HCLK{i}")),
true,
false,
);
diffs.push((val, diff));
}
for i in 0..6 {
let val = format!("RCLK{i}");
let mut diff = ctx.state.get_diff(tile, bel, mux, &val);
diff.apply_bit_diff(
ctx.tiledb.item(tile, bel, &format!("ENABLE.RCLK{i}")),
true,
false,
);
diffs.push((val, diff));
}
ctx.tiledb
.insert(tile, bel, mux, xlat_enum_ocd(diffs, OcdMode::Mux));
}
}
}

let tile = "PMVIOB";
let bel = "PMVIOB";
ctx.state.get_diff(tile, bel, "PRESENT", "1").assert_empty();
ctx.collect_enum_bool(tile, bel, "HYS_IN", "FALSE", "TRUE");
ctx.collect_enum_bool(tile, bel, "HSLEW4_IN", "FALSE", "TRUE");
ctx.collect_enum_bool(tile, bel, "PSLEW4_IN", "FALSE", "TRUE");
}
Loading

0 comments on commit 8cd1a50

Please sign in to comment.