fix 16v8 regression with tristate/registered

Tristate can't be set on registered logic in 16V8. We add a check
to skip those.
This commit is contained in:
saji 2024-05-05 17:29:25 -05:00
parent 3489b97b16
commit fb4ae03c91

View file

@ -303,7 +303,7 @@ pub fn graph_convert(graph: &Graph, pcf: &PcfFile, chip: Chip) -> Result<Bluepri
Some(port) => { Some(port) => {
info!("Found a port, performing port lookup"); info!("Found a port, performing port lookup");
let pin = port let pin = port
.lookup(&pcf) .lookup(pcf)
.ok_or(MappingError::MissingConstraint(port.clone()))?; .ok_or(MappingError::MissingConstraint(port.clone()))?;
let olmc_row = chip let olmc_row = chip
.pin_to_olmc(pin as usize) .pin_to_olmc(pin as usize)
@ -318,15 +318,14 @@ pub fn graph_convert(graph: &Graph, pcf: &PcfFile, chip: Chip) -> Result<Bluepri
name: sop.name.unwrap(), name: sop.name.unwrap(),
sop_size: sopsize, sop_size: sopsize,
wanted_size: rowsize, wanted_size: rowsize,
} });
.into());
} }
info!("Found a real pin to map: Mapping node {o:?} onto row {olmc_row}"); info!("Found a real pin to map: Mapping node {o:?} onto row {olmc_row}");
// check if OLMC row is already in use // check if OLMC row is already in use
if let Some(o) = olmcmap[olmc_row] { if let Some(o) = olmcmap[olmc_row] {
error!("already exists in {o:?}"); error!("already exists in {o:?}");
return Err(MappingError::Unknown.into()); return Err(MappingError::Unknown);
} }
olmcmap[olmc_row] = Some(o); olmcmap[olmc_row] = Some(o);
} }
@ -372,7 +371,7 @@ pub fn graph_convert(graph: &Graph, pcf: &PcfFile, chip: Chip) -> Result<Bluepri
debug!("Mapping node {node} at row {idx}"); debug!("Mapping node {node} at row {idx}");
let sop = get_sop_for_olmc(graph, node, "A")?; let sop = get_sop_for_olmc(graph, node, "A")?;
debug!("Got SOP {:?} attached to node", sop); debug!("Got SOP {:?} attached to node", sop);
let term = make_term_from_sop(graph, &pcf, &olmcmap, &chip, sop); let term = make_term_from_sop(graph, pcf, &olmcmap, &chip, sop);
debug!("Got term {:?}", term); debug!("Got term {:?}", term);
let gal_olmc_node = graph.get_node(node).unwrap(); let gal_olmc_node = graph.get_node(node).unwrap();
if let Node::Olmc(o) = gal_olmc_node { if let Node::Olmc(o) = gal_olmc_node {
@ -390,7 +389,7 @@ pub fn graph_convert(graph: &Graph, pcf: &PcfFile, chip: Chip) -> Result<Bluepri
debug!("Sop found, {:?}", tri_sop); debug!("Sop found, {:?}", tri_sop);
assert_eq!(tri_sop.parameters.depth, 1); assert_eq!(tri_sop.parameters.depth, 1);
let tri_term = let tri_term =
make_term_from_sop(graph, &pcf, &olmcmap, &chip, tri_sop); make_term_from_sop(graph, pcf, &olmcmap, &chip, tri_sop);
debug!("Term for tristate SOP made = {:?}", tri_term); debug!("Term for tristate SOP made = {:?}", tri_term);
tri_term tri_term
} }
@ -423,7 +422,9 @@ pub fn graph_convert(graph: &Graph, pcf: &PcfFile, chip: Chip) -> Result<Bluepri
.set_base(&outpin, term, pinmode) .set_base(&outpin, term, pinmode)
.ok_or(MappingError::Unknown)?; .ok_or(MappingError::Unknown)?;
let dummy_pin = Pin { pin: 0, neg: false }; let dummy_pin = Pin { pin: 0, neg: false };
if !(matches!(chip, Chip::GAL16V8) && o.parameters.registered) {
bp.olmcs[idx].set_enable(&dummy_pin, tri_term)?; bp.olmcs[idx].set_enable(&dummy_pin, tri_term)?;
}
} else { } else {
panic!("screaming"); panic!("screaming");
} }