partially working

This commit is contained in:
saji 2024-05-04 15:06:22 -05:00
parent a550d84750
commit 4154a18e90
3 changed files with 13 additions and 14 deletions

View file

@ -46,17 +46,10 @@ fn get_sop_for_olmc(graph: &Graph, olmc_idx: &NodeIdx) -> Result<GalSop, Mapping
}
})
.collect();
assert_eq!(sops_on_net.len(), 1, "Should only be one sop driving a net");
if sops_on_net.is_empty() {
return Err(MappingError::MissingSOP);
}
Ok(sops_on_net[0].clone())
// let other_node = input[0].get_other(olmc_idx).ok_or(MappingError::Unknown)?;
// let sop = graph
// .get_node(&other_node.0)
// .ok_or(MappingError::MissingSOP)?;
// if let Node::Sop(s) = sop {
// Ok(s.clone())
// } else {
// Err(MappingError::MissingSOP)
// }
}
fn map_remaining_olmc(
@ -123,8 +116,8 @@ fn find_hwpin_for_net(graph: &Graph, pcf: &PcfFile, net: &Net) -> Result<u32, Ma
assert_eq!(port_nets.len(), 1, "should only be one input to GAL_INPUT");
let pnet = &port_nets[0];
if let Some(p) = graph.find_port(&pnet) {
info!("Found a port after traversing inputs");
if let Some(p) = graph.find_port(pnet) {
debug!("Found a port after traversing inputs, {:?}", p);
// look up the pin.
p.lookup(pcf)
.ok_or(MappingError::MissingConstraint(p.clone()))

View file

@ -80,8 +80,7 @@ fn synth(s: SynthArgs) -> Result<()> {
let pcf_string = std::str::from_utf8(pcf_file)?;
let pcf = parse_pcf(pcf_string);
let res = graph_convert(&g, pcf, Chip::GAL16V8);
let res = graph_convert(&g, pcf, Chip::GAL16V8)?;
Ok(())
}

View file

@ -0,0 +1,7 @@
set_io clk 1
set_io A 3
set_io B 4
set_io AND 13
set_io NAND 14
set_io REG_AND 15
set_io REG_NAND 16