{"abstract":"Asserting reset between clock edges leaves q at its old value until the next rising edge.","category":"Digital logic simulation","checks":7,"contract":"Input: samples [clk, d, en, rst_n] at successive instants. q starts as \"x\". Active-low rst_n==0 forces q=0 immediately regardless of clock. Otherwise a rising clock edge (previous sample clk 0, this sample clk 1; the first sample is never an edge) with en==1 loads d. The previous clock value is tracked on every sample, including while reset is asserted. Return q after each sample.","evaluation_group":"w2-digital-logic-simulation-dff-async-reset","failed_approach":"Gating reset on clock-high still ignores a reset asserted while the clock is low.","family":"w2-digital-logic-simulation-dff-async-reset-asynchronous-reset","id":"FA-88916","implementations":{"attempt":{"sha256":"665ce11977cea55560a3ed5b6591450b3b6b53657e662b14e805be7706a95ad6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(samples):\n    out = []\n    q = 'x'\n    prev = None\n    for c, d, en, rst_n in samples:\n        edge = prev == 0 and c == 1\n        prev = c\n        if rst_n == 0 and c == 1:\n            q = 0\n        elif edge and en == 1:\n            q = d\n        out.append(q)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1]]], ['x', 1, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1]]], ['x', 1, 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 0]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [0, 1, 1, 1]]], ['x', 1, 0, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1, 1, 0])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]]], ['x', 1, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1]]], ['x', 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 0]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1]]], ['x', 1, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1]]], ['x', 1, 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [0, 1, 1, 1]]], ['x', 1, 0, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1, 1, 0])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"16d57c77582782710908c73a6cf0e2cf667eef29b7fd8fac0d804636e8926c48","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(samples):\n    out = []\n    q = 'x'\n    prev = None\n    for c, d, en, rst_n in samples:\n        edge = prev == 0 and c == 1\n        prev = c\n        if rst_n == 0 and edge:\n            q = 0\n        elif edge and en == 1:\n            q = d\n        out.append(q)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1]]], ['x', 1, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1]]], ['x', 1, 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 0]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [0, 1, 1, 1]]], ['x', 1, 0, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1, 1, 0])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]]], ['x', 1, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1]]], ['x', 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 0]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1]]], ['x', 1, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1]]], ['x', 1, 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [0, 1, 1, 1]]], ['x', 1, 0, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1, 1, 0])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"b0768d8ec9763c6963ba8f4bbe67cbf2fff5fa5e9896180871f216d4384e9edb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(samples):\n    out = []\n    q = 'x'\n    prev = None\n    for c, d, en, rst_n in samples:\n        edge = prev == 0 and c == 1\n        prev = c\n        if rst_n == 0:\n            q = 0\n        elif edge and en == 1:\n            q = d\n        out.append(q)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1]]], ['x', 1, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1]]], ['x', 1, 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 0]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [0, 1, 1, 1]]], ['x', 1, 0, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1, 1, 0])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]]], ['x', 1, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1]]], ['x', 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 0]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1]]], ['x', 1, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1]]], ['x', 1, 1, 1, 1])], [('uninitialized flop holds x until first edge', [[[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1]]], ['x', 'x', 1]), ('async reset between edges', [[[0, 0, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1], [0, 1, 1, 1]]], ['x', 1, 0, 0, 0]), ('reset held low while clock rises', [[[0, 0, 1, 0], [1, 1, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]), ('reset released during clock high', [[[0, 1, 1, 1], [0, 1, 1, 0], [1, 1, 1, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 0, 0, 0, 0, 0]), ('falling edges do not capture', [[[1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 'x', 1, 1, 1, 0, 0, 0, 0, 0]), ('clock held high does not recapture', [[[0, 1, 1, 1], [1, 1, 1, 1], [1, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1]), ('enable low holds value', [[[0, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 1], [1, 0, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1]]], ['x', 1, 1, 1, 1, 0])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model of one simulator rule set; the contract is stipulated and is not a claim of conformance to any HDL standard or commercial simulator. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-digital-logic-simulation-dff-async-reset-asynchronous-reset","generated_at":"2026-09-29T14:51:12.675575+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Register models in cycle simulators must distinguish asynchronous from synchronous control and detect true clock edges.","repair":"Apply reset on every sample where rst_n is 0, independent of the clock.","root_cause":"The reset branch is gated by the clock edge, turning an asynchronous reset into a synchronous one.","sha256":"216562fe3e4912e4d59a10b0160b2ee759dff840708690a8255a6f1bde01c7cb","title":"Asynchronous reset waits for a clock edge · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.842,"exit_code":1,"observations":[{"actual":["x","x",1],"check":"uninitialized flop holds x until first edge","expected":["x","x",1],"passed":true},{"actual":["x",1,0,0],"check":"async reset between edges","expected":["x",1,0,0],"passed":true},{"actual":["x",0,0,0,0,1],"check":"reset held low while clock rises","expected":[0,0,0,0,0,1],"passed":false},{"actual":["x","x",0,0,0,0],"check":"reset released during clock high","expected":["x",0,0,0,0,0],"passed":false},{"actual":["x","x",1,1,1,0],"check":"falling edges do not capture","expected":["x","x",1,1,1,0],"passed":true},{"actual":["x",1,1,1],"check":"clock held high does not recapture","expected":["x",1,1,1],"passed":true},{"actual":["x",1,1,1,1],"check":"enable low holds value","expected":["x",1,1,1,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"uninitialized flop holds x until first edge\", \"actual\": [\"x\", \"x\", 1], \"expected\": [\"x\", \"x\", 1], \"passed\": true}, {\"check\": \"async reset between edges\", \"actual\": [\"x\", 1, 0, 0], \"expected\": [\"x\", 1, 0, 0], \"passed\": true}, {\"check\": \"reset held low while clock rises\", \"actual\": [\"x\", 0, 0, 0, 0, 1], \"expected\": [0, 0, 0, 0, 0, 1], \"passed\": false}, {\"check\": \"reset released during clock high\", \"actual\": [\"x\", \"x\", 0, 0, 0, 0], \"expected\": [\"x\", 0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"falling edges do not capture\", \"actual\": [\"x\", \"x\", 1, 1, 1, 0], \"expected\": [\"x\", \"x\", 1, 1, 1, 0], \"passed\": true}, {\"check\": \"clock held high does not recapture\", \"actual\": [\"x\", 1, 1, 1], \"expected\": [\"x\", 1, 1, 1], \"passed\": true}, {\"check\": \"enable low holds value\", \"actual\": [\"x\", 1, 1, 1, 1], \"expected\": [\"x\", 1, 1, 1, 1], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.875,"exit_code":1,"observations":[{"actual":["x","x",1],"check":"uninitialized flop holds x until first edge","expected":["x","x",1],"passed":true},{"actual":["x",1,1,1],"check":"async reset between edges","expected":["x",1,0,0],"passed":false},{"actual":["x",0,0,0,0,1],"check":"reset held low while clock rises","expected":[0,0,0,0,0,1],"passed":false},{"actual":["x","x",0,0,0,0],"check":"reset released during clock high","expected":["x",0,0,0,0,0],"passed":false},{"actual":["x","x",1,1,1,0],"check":"falling edges do not capture","expected":["x","x",1,1,1,0],"passed":true},{"actual":["x",1,1,1],"check":"clock held high does not recapture","expected":["x",1,1,1],"passed":true},{"actual":["x",1,1,1,1],"check":"enable low holds value","expected":["x",1,1,1,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"uninitialized flop holds x until first edge\", \"actual\": [\"x\", \"x\", 1], \"expected\": [\"x\", \"x\", 1], \"passed\": true}, {\"check\": \"async reset between edges\", \"actual\": [\"x\", 1, 1, 1], \"expected\": [\"x\", 1, 0, 0], \"passed\": false}, {\"check\": \"reset held low while clock rises\", \"actual\": [\"x\", 0, 0, 0, 0, 1], \"expected\": [0, 0, 0, 0, 0, 1], \"passed\": false}, {\"check\": \"reset released during clock high\", \"actual\": [\"x\", \"x\", 0, 0, 0, 0], \"expected\": [\"x\", 0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"falling edges do not capture\", \"actual\": [\"x\", \"x\", 1, 1, 1, 0], \"expected\": [\"x\", \"x\", 1, 1, 1, 0], \"passed\": true}, {\"check\": \"clock held high does not recapture\", \"actual\": [\"x\", 1, 1, 1], \"expected\": [\"x\", 1, 1, 1], \"passed\": true}, {\"check\": \"enable low holds value\", \"actual\": [\"x\", 1, 1, 1, 1], \"expected\": [\"x\", 1, 1, 1, 1], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.783,"exit_code":0,"observations":[{"actual":["x","x",1],"check":"uninitialized flop holds x until first edge","expected":["x","x",1],"passed":true},{"actual":["x",1,0,0],"check":"async reset between edges","expected":["x",1,0,0],"passed":true},{"actual":[0,0,0,0,0,1],"check":"reset held low while clock rises","expected":[0,0,0,0,0,1],"passed":true},{"actual":["x",0,0,0,0,0],"check":"reset released during clock high","expected":["x",0,0,0,0,0],"passed":true},{"actual":["x","x",1,1,1,0],"check":"falling edges do not capture","expected":["x","x",1,1,1,0],"passed":true},{"actual":["x",1,1,1],"check":"clock held high does not recapture","expected":["x",1,1,1],"passed":true},{"actual":["x",1,1,1,1],"check":"enable low holds value","expected":["x",1,1,1,1],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"uninitialized flop holds x until first edge\", \"actual\": [\"x\", \"x\", 1], \"expected\": [\"x\", \"x\", 1], \"passed\": true}, {\"check\": \"async reset between edges\", \"actual\": [\"x\", 1, 0, 0], \"expected\": [\"x\", 1, 0, 0], \"passed\": true}, {\"check\": \"reset held low while clock rises\", \"actual\": [0, 0, 0, 0, 0, 1], \"expected\": [0, 0, 0, 0, 0, 1], \"passed\": true}, {\"check\": \"reset released during clock high\", \"actual\": [\"x\", 0, 0, 0, 0, 0], \"expected\": [\"x\", 0, 0, 0, 0, 0], \"passed\": true}, {\"check\": \"falling edges do not capture\", \"actual\": [\"x\", \"x\", 1, 1, 1, 0], \"expected\": [\"x\", \"x\", 1, 1, 1, 0], \"passed\": true}, {\"check\": \"clock held high does not recapture\", \"actual\": [\"x\", 1, 1, 1], \"expected\": [\"x\", 1, 1, 1], \"passed\": true}, {\"check\": \"enable low holds value\", \"actual\": [\"x\", 1, 1, 1, 1], \"expected\": [\"x\", 1, 1, 1, 1], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}