Skip to content

Commit

Permalink
ise_hammer: HCLK_* GLUTMASK, MCB *MR.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanda-phi committed Oct 14, 2024
1 parent 9f31943 commit 19dd549
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 4 deletions.
2 changes: 1 addition & 1 deletion databases/xc6s-tiledb.json

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions docs/xilinx/spartan6/clock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ Bitstream — ``HCLK``
:file: ../gen/tile-xc6s-HCLK.html


Bitstream — ``HCLK_CLEXL``
==========================

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


Bitstream — ``HCLK_CLEXM``
==========================

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


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

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


Bitstream — ``HCLK_GTP``
========================

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


Bitstream — ``HCLK_ROW``
========================

Expand Down
45 changes: 43 additions & 2 deletions prjcombine_ise_hammer/src/clk/spartan6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use bitvec::vec::BitVec;
use prjcombine_hammer::Session;
use prjcombine_int::db::{BelId, Dir};
use prjcombine_spartan6::grid::Gts;
use prjcombine_types::TileItemKind;
use prjcombine_types::{TileItem, TileItemKind};
use prjcombine_xilinx_geom::ExpandedDevice;
use unnamed_entity::EntityId;

use crate::{
backend::IseBackend,
backend::{FeatureBit, IseBackend},
diff::{xlat_bit, xlat_bit_wide, xlat_enum, xlat_enum_ocd, CollectorCtx, OcdMode},
fgen::{ExtraFeature, ExtraFeatureKind, TileBits, TileKV},
fuzz::FuzzCtx,
Expand Down Expand Up @@ -1174,4 +1174,45 @@ pub fn collect_fuzzers(ctx: &mut CollectorCtx, devdata_only: bool) {
ctx.tiledb
.insert(tile, bel, "PCI_CE_DELAY", xlat_enum(diffs));
}
for (tile, frame, bit, target) in [
// used in CLEXL (incl. spine) and DSP columns; also used on PCIE sides and left GTP side
("HCLK_CLEXL", 16, 0, 21),
("HCLK_CLEXL", 17, 0, 22),
("HCLK_CLEXL", 18, 0, 23),
("HCLK_CLEXL", 19, 0, 24),
("HCLK_CLEXL", 16, 1, 26),
("HCLK_CLEXL", 17, 1, 27),
("HCLK_CLEXL", 18, 1, 28),
("HCLK_CLEXL", 19, 1, 29),
// used in CLEXM columns
("HCLK_CLEXM", 16, 0, 21),
("HCLK_CLEXM", 17, 0, 22),
("HCLK_CLEXM", 18, 0, 24),
("HCLK_CLEXM", 19, 0, 25),
("HCLK_CLEXM", 16, 1, 27),
("HCLK_CLEXM", 17, 1, 28),
("HCLK_CLEXM", 18, 1, 29),
("HCLK_CLEXM", 19, 1, 30),
// used in IOI columns
("HCLK_IOI", 16, 0, 25),
("HCLK_IOI", 18, 0, 23),
("HCLK_IOI", 19, 0, 24),
("HCLK_IOI", 16, 1, 21),
("HCLK_IOI", 17, 1, 27),
("HCLK_IOI", 18, 1, 28),
("HCLK_IOI", 19, 1, 29),
// used on right GTP side
("HCLK_GTP", 16, 0, 25),
("HCLK_GTP", 17, 0, 22),
("HCLK_GTP", 18, 0, 23),
("HCLK_GTP", 19, 0, 24),
// BRAM columns do not have masking
] {
ctx.tiledb.insert(
tile,
"GLUTMASK",
format!("FRAME{target}"),
TileItem::from_bit(FeatureBit::new(0, frame, bit), false),
)
}
}
17 changes: 16 additions & 1 deletion prjcombine_ise_hammer/src/mcb.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use prjcombine_hammer::Session;
use prjcombine_types::TileItem;

use crate::{
backend::IseBackend,
backend::{FeatureBit, IseBackend},
diff::{xlat_bool, xlat_enum, CollectorCtx, Diff},
fgen::TileBits,
fuzz::FuzzCtx,
Expand Down Expand Up @@ -259,6 +260,7 @@ pub fn add_fuzzers<'a>(session: &mut Session<IseBackend<'a>>, backend: &IseBacke
for val in ["DISABLED", "ENABLED"] {
fuzz_one!(ctx, "MEM_PLL_DIV_EN", val, [
(global_mutex_site "MCB"),
(global_mutex "DRPSDO", "NOPE"),
(mode "MCB")
], [
(global_opt "MEM_PLL_DIV_EN", val)
Expand All @@ -267,6 +269,7 @@ pub fn add_fuzzers<'a>(session: &mut Session<IseBackend<'a>>, backend: &IseBacke
for val in ["INVERTED", "NOTINVERTED"] {
fuzz_one!(ctx, "MEM_PLL_POL_SEL", val, [
(global_mutex_site "MCB"),
(global_mutex "DRPSDO", "NOPE"),
(mode "MCB")
], [
(global_opt "MEM_PLL_POL_SEL", val)
Expand Down Expand Up @@ -544,4 +547,16 @@ pub fn collect_fuzzers(ctx: &mut CollectorCtx) {
);
ctx.collect_enum(tile, bel, "MEM_MOBILE_PA_SR", &["HALF", "FULL"]);
ctx.collect_enum(tile, bel, "MEM_MOBILE_TC_SR", &["0", "1", "2", "3"]);

for (reg, bittile) in [("MR", 7), ("EMR1", 6), ("EMR2", 5), ("EMR3", 4)] {
ctx.tiledb.insert(
tile,
bel,
reg,
TileItem::from_bitvec(
(0..14).map(|i| FeatureBit::new(bittile, 22, 18 + i)).collect(),
false,
),
);
}
}

0 comments on commit 19dd549

Please sign in to comment.