{"commit":"d60140ff240a2404ba99f57f794d0a732112dd8f","old_file":"NumConv.bsv","new_file":"NumConv.bsv","old_contents":"function String toHex(Bit#(s) num);\n    function String f(Bit#(s) n);\n        String dig[16] = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"};\n        return (n == 0) ? \"\" : f(n \/ 16) + dig[n % 16];\n    endfunction\n    return (num == 0) ? \"0\" : f(num);\nendfunction\n","new_contents":"function Bit#(n) removeDontCares(Bit#(n) num);\n    Bit#(n) res = 0;\n    for(Integer i = 0; i < valueOf(n); i = i + 1)\n        res[i] = (num[i] == 1'b1) ? 1'b1 : 1'b0;\n    return res;\nendfunction\n\nfunction String toHex(Bit#(n) num)\nprovisos (\n    Div#(n   , 4, ndig),\n    Mul#(ndig, 4, nadj),\n    Add#(pad , n, nadj)\n);\n    String dig[16] = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"};\n    Bit#(nadj) numadj = extend(removeDontCares(num));\n    String res = \"\";\n    for(Integer i = valueOf(nadj) - 1; i >= 0; i = i - 4) begin\n        Bit#(4) dign = numadj[i:i-3];\n        res = res + dig[dign];\n    end\n    return res;\nendfunction\n","subject":"Implement toHex supporting don't-care bits","message":"Implement toHex supporting don't-care bits\n\nPreviously, don't-care bits would trigger an infinite loop during the elaboration phase.\n","lang":"Bluespec","license":"mit","repos":"thotypous\/altsourceprobe"}
{"commit":"09a43116c9922d0e5d572e1274e451aa4de01ac6","old_file":"hw\/bsv\/DE5Pins.bsv","new_file":"hw\/bsv\/DE5Pins.bsv","old_contents":"import Ethernet::*;\n\n(* always_ready, always_enabled *)\ninterface DE5Pins;\n   method Action osc_50(Bit#(1) b3d, Bit#(1) b4a, Bit#(1) b4d, Bit#(1) b7a, Bit#(1) b7d, Bit#(1) b8a, Bit#(1) b8d);\n   method Action sfp(Bit#(1) refclk);\n   method Action buttons(Bit#(4) v);\n\/\/   method Bit#(4) serial_tx_data;\n\/\/   method Action serial_rx(Bit#(4) data);\n   interface SFPCtrl#(4) sfpctrl;\n\/\/   method Bit#(1) led0;\n\/\/   method Bit#(1) led1;\n\/\/   method Bit#(1) led2;\n   method Bit#(1) led3;\n   method Bit#(4) led_bracket;\n   interface Clock deleteme_unused_clock;\n   interface Clock deleteme_unused_clock2;\n   interface Clock deleteme_unused_clock3;\n   interface Reset deleteme_unused_reset;\nendinterface\n\n","new_contents":"import Ethernet::*;\n\n(* always_ready, always_enabled *)\ninterface DE5Pins;\n   method Action osc_50(Bit#(1) b3d, Bit#(1) b4a, Bit#(1) b4d, Bit#(1) b7a, Bit#(1) b7d, Bit#(1) b8a, Bit#(1) b8d);\n   method Action sfp(Bit#(1) refclk);\n   method Action buttons(Bit#(4) v);\n\/\/   method Bit#(4) serial_tx_data;\n\/\/   method Action serial_rx(Bit#(4) data);\n   interface SFPCtrl#(4) sfpctrl;\n   method Bit#(1) led0;\n\/\/   method Bit#(1) led1;\n\/\/   method Bit#(1) led2;\n   method Bit#(1) led3;\n   method Bit#(4) led_bracket;\n`ifndef BSIM\n   interface Clock deleteme_unused_clock;\n   interface Clock deleteme_unused_clock2;\n   interface Clock deleteme_unused_clock3;\n   interface Reset deleteme_unused_reset;\n   `endif\nendinterface\n\n","subject":"Fix \"Attempt to use this undetermined clock\" Error","message":"Fix \"Attempt to use this undetermined clock\" Error\n","lang":"Bluespec","license":"mit","repos":"hanw\/sonic-lite,hanw\/sonic-lite,hanw\/sonic-lite,hanw\/sonic-lite"}
