Skip to content

Commit

Permalink
ise_hammer: virtex iob
Browse files Browse the repository at this point in the history
  • Loading branch information
wanda-phi committed Aug 5, 2024
1 parent 769fd16 commit 830785f
Show file tree
Hide file tree
Showing 13 changed files with 788 additions and 57 deletions.
2 changes: 1 addition & 1 deletion databases/xcv-tiledb.json

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions docs/gen_xilinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def emit_misc_table(fname, *prefixes):
f.write(f"<tr><th rowspan=\"2\">Name</th>")
for (pref, l) in zip(prefixes, lens):
if l == -1:
f.write(f"<th colspan=\"{l}\">{pref}</th>")
else:
f.write(f"<th rowspan=\"2\">{pref}</th>")
else:
f.write(f"<th colspan=\"{l}\">{pref}</th>")
f.write(f"</tr>\n")
f.write(f"<tr>")
for l in lens:
Expand Down Expand Up @@ -233,6 +233,14 @@ def emit_dev_table_string(f, name):
f.write("</tr>\n")
f.write("</table>\n")

if kind == "xcv":
emit_misc_table("xilinx/gen/xcv-iostd-misc.html", "IOSTD:V:IOSTD_MISC", "IOSTD:V:OUTPUT_MISC")
emit_misc_table("xilinx/gen/xcv-iostd-drive.html", "IOSTD:V:PDRIVE", "IOSTD:V:NDRIVE")
emit_misc_table("xilinx/gen/xcv-iostd-slew.html", "IOSTD:V:SLEW")
emit_misc_table("xilinx/gen/xcve-iostd-misc.html", "IOSTD:VE:IOSTD_MISC", "IOSTD:VE:OUTPUT_MISC")
emit_misc_table("xilinx/gen/xcve-iostd-drive.html", "IOSTD:VE:PDRIVE", "IOSTD:VE:NDRIVE")
emit_misc_table("xilinx/gen/xcve-iostd-slew.html", "IOSTD:VE:SLEW")

if kind == "xc2v":
emit_misc_table("xilinx/gen/xc2v-iostd-drive.html", "IOSTD:V2:PDRIVE", "IOSTD:V2:NDRIVE")
emit_misc_table("xilinx/gen/xc2v-iostd-slew.html", "IOSTD:V2:SLEW")
Expand Down
26 changes: 26 additions & 0 deletions docs/xilinx/virtex/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,29 @@ Input/Output

.. raw:: html
:file: ../gen/tile-xcv-IOB.T.VE.html


I/O buffers — Virtex
====================

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

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

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


I/O buffers — Virtex E
======================

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

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

.. raw:: html
:file: ../gen/xcve-iostd-misc.html
4 changes: 2 additions & 2 deletions docs/xilinx/virtex2/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ I/O interface
:file: ../gen/tile-xc2v-IOI.CLK_T.html


I/O buffers
===========
I/O buffers — Virtex 2
======================

.. todo:: document

Expand Down
2 changes: 1 addition & 1 deletion prjcombine_ise_hammer/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Debug for FuzzerInfo {
}
}

#[derive(Clone, Eq, PartialEq, Hash)]
#[derive(Clone, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct FeatureId {
pub tile: String,
pub bel: String,
Expand Down
96 changes: 76 additions & 20 deletions prjcombine_ise_hammer/src/clk/virtex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ use prjcombine_hammer::Session;

use crate::{
backend::IseBackend,
diff::{xlat_bitvec, xlat_bool, CollectorCtx},
fgen::TileBits,
diff::{xlat_bitvec, xlat_bool, xlat_enum, CollectorCtx, Diff},
fgen::{BelKV, TileBits},
fuzz::FuzzCtx,
fuzz_enum, fuzz_one,
};

pub fn add_fuzzers<'a>(session: &mut Session<IseBackend<'a>>, backend: &IseBackend<'a>) {
let package = backend.ebonds.keys().next().unwrap();
for tile in [
"CLKB",
"CLKT",
Expand All @@ -27,23 +28,31 @@ pub fn add_fuzzers<'a>(session: &mut Session<IseBackend<'a>>, backend: &IseBacke
) else {
continue;
};
// fuzz_one!(ctx, "PRESENT", "1", [], [(mode "GCLKIOB")]);
// let iostds = if !tile.ends_with("DLL") {
// &[
// "LVTTL", "LVCMOS2", "PCI33_3", "PCI33_5", "PCI66_3", "GTL", "GTLP", "HSTL_I",
// "HSTL_III", "HSTL_IV", "SSTL3_I", "SSTL3_II", "SSTL2_I", "SSTL2_II", "CTT",
// "AGP",
// ][..]
// } else {
// &[
// "LVTTL", "LVCMOS2", "LVCMOS18", "PCI33_3", "PCI66_3", "PCIX66_3", "GTL",
// "GTLP", "HSTL_I", "HSTL_III", "HSTL_IV", "SSTL3_I", "SSTL3_II", "SSTL2_I",
// "SSTL2_II", "CTT", "AGP", "LVDS", "LVPECL",
// ][..]
// };
// fuzz_enum!(ctx, "IOATTRBOX", iostds.iter().copied(), [
// (mode "GCLKIOB")
// ]);
let iostds = if !tile.ends_with("DLL") {
&[
"LVTTL", "LVCMOS2", "PCI33_3", "PCI33_5", "PCI66_3", "GTL", "GTLP", "HSTL_I",
"HSTL_III", "HSTL_IV", "SSTL3_I", "SSTL3_II", "SSTL2_I", "SSTL2_II", "CTT",
"AGP",
][..]
} else {
&[
"LVTTL", "LVCMOS2", "LVCMOS18", "PCI33_3", "PCI66_3", "PCIX66_3", "GTL",
"GTLP", "HSTL_I", "HSTL_III", "HSTL_IV", "SSTL3_I", "SSTL3_II", "SSTL2_I",
"SSTL2_II", "CTT", "AGP", "LVDS", "LVPECL",
][..]
};
for &iostd in iostds {
fuzz_one!(ctx, "IOATTRBOX", iostd, [
(global_mutex "GCLKIOB", "YES"),
(package package),
(global_mutex "VREF", "YES"),
(bel_special BelKV::OtherIobInput("GTL".into())),
(global_opt "UNUSEDPIN", "PULLNONE")
], [
(mode "GCLKIOB"),
(attr "IOATTRBOX", iostd)
]);
}
let idx = if tile.starts_with("CLKB") { i } else { 2 + i };
for val in ["11110", "11101", "11011", "10111", "01111"] {
fuzz_one!(ctx, "DELAY", val, [
Expand Down Expand Up @@ -157,7 +166,54 @@ pub fn collect_fuzzers(ctx: &mut CollectorCtx) {
let diff = ctx.state.get_diff(tile, bel, "DELAY", val);
diffs.push(!diff);
}
ctx.tiledb.insert(tile, bel, "DELAY", xlat_bitvec(diffs))
ctx.tiledb.insert(tile, bel, "DELAY", xlat_bitvec(diffs));
let iostds = if !tile.ends_with("DLL") {
&[
("CMOS", "LVTTL"),
("CMOS", "LVCMOS2"),
("CMOS", "PCI33_3"),
("CMOS", "PCI33_5"),
("CMOS", "PCI66_3"),
("VREF_LV", "GTL"),
("VREF_LV", "HSTL_I"),
("VREF_LV", "HSTL_III"),
("VREF_LV", "HSTL_IV"),
("VREF_HV", "GTLP"),
("VREF_HV", "SSTL3_I"),
("VREF_HV", "SSTL3_II"),
("VREF_HV", "SSTL2_I"),
("VREF_HV", "SSTL2_II"),
("VREF_HV", "CTT"),
("VREF_HV", "AGP"),
][..]
} else {
&[
("CMOS", "LVTTL"),
("CMOS", "LVCMOS2"),
("CMOS", "LVCMOS18"),
("CMOS", "PCI33_3"),
("CMOS", "PCI66_3"),
("CMOS", "PCIX66_3"),
("VREF", "GTL"),
("VREF", "GTLP"),
("VREF", "HSTL_I"),
("VREF", "HSTL_III"),
("VREF", "HSTL_IV"),
("VREF", "SSTL3_I"),
("VREF", "SSTL3_II"),
("VREF", "SSTL2_I"),
("VREF", "SSTL2_II"),
("VREF", "CTT"),
("VREF", "AGP"),
("DIFF", "LVDS"),
("DIFF", "LVPECL"),
][..]
};
let mut diffs = vec![("NONE", Diff::default())];
for &(val, iostd) in iostds {
diffs.push((val, ctx.state.get_diff(tile, bel, "IOATTRBOX", iostd)));
}
ctx.tiledb.insert(tile, bel, "IBUF", xlat_enum(diffs));
}
for i in 0..2 {
let bel = format!("BUFG{i}");
Expand Down
Loading

0 comments on commit 830785f

Please sign in to comment.