anchor.diff:     endinterface
   endmodule
   
  -module mkMatchTableBluesim(MatchTable#(id, depth, keySz, actionSz))
  +module mkMatchTableBluesim#(String name)(MatchTable#(id, depth, keySz, actionSz))
      provisos (MatchTable::MatchTableSim#(id, keySz, actionSz),
                Log#(depth, depthSz));
      let verbose = True;
   
  +   Integer idv = valueOf(id);
  +   Integer dpv = valueOf(depth);
      FIFO#(Tuple2#(Bit#(keySz), Bit#(actionSz))) writeReqFifo <- mkFIFO;
      FIFO#(Bit#(keySz)) readReqFifo <- mkFIFO;
      FIFO#(Maybe#(Bit#(actionSz))) readDataFifo <- mkFIFO;
   
      Reg#(Bool)      isInitialized   <- mkReg(False);
  +
  +   Handle fp <- openFile(name, ReadMode);
  +   List#(Tuple2#(Bit#(keySz), Bit#(actionSz))) entryList = tagged Nil;
  +   let readable <- hIsReadable(fp);
  +   if (readable) begin
  +      Bool isEOF <- hIsEOF(fp);
  +      while (!isEOF) begin
  +         let line <- hGetLine(fp);
  +         List#(String) parsedEntries = parseCSV(line);
  +         while (parsedEntries != tagged Nil) begin
  +            Bit#(keySz) key = fromInteger(hexStringToInteger(parsedEntries[0]));
  +            Bit#(actionSz) v = fromInteger(hexStringToInteger(parsedEntries[1]));
  +            Bit#(id) tid = 0;
  +            parsedEntries = List::drop(2, parsedEntries);
  +            entryList = List::cons(tuple2(key, v), entryList);
  +         end
  +         isEOF <- hIsEOF(fp);
  +      end
  +   end
  +   hClose(fp);
   
      rule do_read (isInitialized);
         let v <- toGet(readReqFifo).get;
  
positive.code:    function Action matchtable_write(Bit#(id) v, Bit#(ksz) key, Bit#(vsz) data);
  endtypeclass
  
  module mkMatchTable(MatchTable#(id, depth, keySz, actionSz))
     provisos(Mul#(c__, 256, d__),
              Add#(c__, 7, TLog#(depth)),
              Log#(d__, TLog#(depth)),
  
negative.code: 
     MatchTable#(id, depth, keySz, actionSz) ret_ifc;
  `ifdef SIMULATION
     ret_ifc <- mkMatchTableBluesim(name);
  `else
     ret_ifc <- mkMatchTableSynth();
  `endif
  