mirror of
https://github.com/annoyatron255/yosys4gal.git
synced 2024-12-22 18:52:23 +00:00
partially working
This commit is contained in:
parent
a550d84750
commit
4154a18e90
|
@ -46,17 +46,10 @@ fn get_sop_for_olmc(graph: &Graph, olmc_idx: &NodeIdx) -> Result<GalSop, Mapping
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.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())
|
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(
|
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");
|
assert_eq!(port_nets.len(), 1, "should only be one input to GAL_INPUT");
|
||||||
let pnet = &port_nets[0];
|
let pnet = &port_nets[0];
|
||||||
|
|
||||||
if let Some(p) = graph.find_port(&pnet) {
|
if let Some(p) = graph.find_port(pnet) {
|
||||||
info!("Found a port after traversing inputs");
|
debug!("Found a port after traversing inputs, {:?}", p);
|
||||||
// look up the pin.
|
// look up the pin.
|
||||||
p.lookup(pcf)
|
p.lookup(pcf)
|
||||||
.ok_or(MappingError::MissingConstraint(p.clone()))
|
.ok_or(MappingError::MissingConstraint(p.clone()))
|
||||||
|
|
|
@ -80,8 +80,7 @@ fn synth(s: SynthArgs) -> Result<()> {
|
||||||
let pcf_string = std::str::from_utf8(pcf_file)?;
|
let pcf_string = std::str::from_utf8(pcf_file)?;
|
||||||
let pcf = parse_pcf(pcf_string);
|
let pcf = parse_pcf(pcf_string);
|
||||||
|
|
||||||
let res = graph_convert(&g, pcf, Chip::GAL16V8);
|
let res = graph_convert(&g, pcf, Chip::GAL16V8)?;
|
||||||
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
7
compiler/testcases/pcf/synth_test.pcf
Normal file
7
compiler/testcases/pcf/synth_test.pcf
Normal 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
|
Loading…
Reference in a new issue