fix pin ordering in SOP stuff

This commit is contained in:
saji 2024-05-04 16:55:22 -05:00
parent 2d6f0123cd
commit 22f1a2a26b
2 changed files with 4 additions and 2 deletions

View file

@ -162,7 +162,8 @@ fn make_term_from_sop(graph: &Graph, sop: GalSop, pcf: &PcfFile) -> Term {
let product_size = sop.parameters.width; let product_size = sop.parameters.width;
let chunksize = product_size * 2; // 00 for dontcare, 01 for negation, 10 for positive i think let chunksize = product_size * 2; // 00 for dontcare, 01 for negation, 10 for positive i think
let input_nets = sop.connections.get("A").unwrap(); let mut input_nets = sop.connections.get("A").unwrap().clone();
input_nets.reverse(); // the order is backwards from how we read it in the alg.
let terms: Vec<Vec<Pin>> = table let terms: Vec<Vec<Pin>> = table
.chunks(chunksize as usize) .chunks(chunksize as usize)

View file

@ -1,7 +1,8 @@
module and_gate (clk, A, B, Y); module and_gate (clk, A, B, Y);
input A, B; input A, B;
output Y; input clk;
output reg Y;
always @(posedge clk) begin always @(posedge clk) begin
Y <= A && B; Y <= A && B;