import java.io.*; import byucc.jhdl.base.*; import byucc.jhdl.Xilinx.*; import byucc.jhdl.Xilinx.XC4000.*; import byucc.jhdl.Logic.*; public class char_slice2 extends Logic { public static CellInterface[] cell_interface = { in( "reset", 1 ), in( "char_in", 4 ), in( "src_dist_in", 1 ), out( "reset_out", 1 ), out( "char_out", 4 ), out( "src_dist_out", 1 ) }; public char_slice2(Node parent, Wire reset, Wire char_in, Wire src_dist_in, Wire reset_out, Wire char_out, Wire src_dist_out, char target) { super(parent); connect("reset", reset); connect("reset_out", reset_out); connect("src_dist_in", src_dist_in); connect("src_dist_out", src_dist_out); connect("char_in", char_in); connect("char_out", char_out); Wire match = wire(1, "match"); // Pass reset through reg_o(reset,reset_out); // This is a character comparator, if char_in matches the target char // it will assert match. It also passes char_in to char_out. new charcomp2(this, char_in, match, char_out, target); /* This finite state machine uses the source distance in, match, and state to determine the source distance out. */ new char_fsm2(this, reset, match, src_dist_in, src_dist_out); } }