~ruther/vhdl-i2c

310fc3d4af525be2aacb65f281f4229f4457efe9 — Rutherther 1 year, 6 months ago 37f25c6
docs: finish documentation
3 files changed, 184 insertions(+), 94 deletions(-)

A doc/img/fpga-board-ssd1306.jpg
A doc/img/i2c-ssd1306-counter-diagram.svg
M doc/index.md
A doc/img/fpga-board-ssd1306.jpg => doc/img/fpga-board-ssd1306.jpg +0 -0
A doc/img/i2c-ssd1306-counter-diagram.svg => doc/img/i2c-ssd1306-counter-diagram.svg +4 -0
@@ 0,0 1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file with editors other than draw.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" style="background-color: rgb(255, 255, 255);" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="653px" height="401px" viewBox="-0.5 -0.5 653 401" content="&lt;mxfile host=&quot;app.diagrams.net&quot; modified=&quot;2024-01-21T20:32:43.805Z&quot; agent=&quot;Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0&quot; etag=&quot;RXVGzLPd7uzci68dZPG_&quot; version=&quot;22.1.18&quot; type=&quot;device&quot;&gt;&lt;diagram name=&quot;Page-1&quot; id=&quot;0rmfZxEEtEdj6bjF6xRE&quot;&gt;7V1Lc6M4EP41rto9xIUkxOM4SeaxVZudqZrDzuwlRUC2qSHGCziJ99evZIMNEgZiC2HAuQQECNTd36fu1sMTdPf89jlyVouH0CPBBGre2wTdTyAEAAL6j5VsdiUGMHcF88j30psOBd/9/0haqKWla98jceHGJAyDxF8VC91wuSRuUihzoih8Ld42C4PiW1fOnAgF310nEEv/9r1ksSu1sHYo/0L8+SJ7M9DSK89OdnNaEC8cL3zNFaGPE3QXhWGyO3p+uyMBE14ml91zn45c3X9YRJZJkwd+/oXif77Mfrya/3ro6/eHT/Dh801ay4sTrNMGT6AR0PpuPf+FHs7Z4W9Prvd7Vk5fkLtUcrcbrpcJiY7dvxVFssnkG9G7PcI+UaOXXxd+Qr6vHJddfaUWRcsWyXNAz8D+6RcSJeTtqBTAXrbUKEn4TJJoQ29JH4CGsXtkk52n6nk9aBdkKlvkNJvd56QGNd9XfZA5PUjF/g4VwCYqiGMPIM3Y2lVcIV3hwSCc+25PdIHMrnWBBF340M0J/cIEpltdC8wUBBauyJLxfeT47P/Teja7AMlhDRYkh1HXkrMFydF6qZk5T37gJ+zTZ35wCUbHiw6BrkUHynotTkpk6X1g3T89cwMnjikJFgRTlCJ585Mf7HiK07Of6X3s+P4td9v9JjtZ0rbkHmKnP/PXDo9tz7Lndp9KPMHv4BRCmxOuI5fU996JE81JUtfFiArOKRCX6C8ri0jgJP5L8XPLlJq+4Vvo04bs7QdpoGg/mLOLXTPTp/IODF8R5CqyuIp2chAq2trYvtlnmJ0umN3W1xFtj+r2T+eJesIFk3MCf75k9ki2/hG6ZbD0qav5Ib3w7Hseq+M2IrH/n/O0rY+ZzIo1adtIfDvB91W4Tv3g9OHJ3vvMm1cFqI6ywI02Rci0z7OI7JZwNotJOzoq86aaUAMl3ig5mzG0kxgDqGMM1AfGgGYR6LosxtA1xYwh+pNuEtHH7piH5CTO7ohQs4vigdDIEctJq9emmontglKyAOiCSQW/i1SW4ZJUUseeBgpuwxRiSTzQFW51i3OysT21TkOu4K+LVR3BLtWCs8ndlhr98Y+G3JsMrfLLjjfyYHW7b5Brg5Zgg7HnPJLlFqLDoA5c64FYVpE7gBS7RahISHaxghaJxbgSSxMFGTxGTycWQz+VWKQpXYz8yxJ+ntMwa9dPrBt1WAe2rksxHlBU+A3gfMD24J1JQxa8T0hSNEV2g9DB7JIBsF3eS7/fsTCKFRm8ObSMfijmrlg/vnK8YQA7N7RV7v9njswejnK68GKgl8UUCjAuJhz6kQHX9a7TuFCMjs+ix6F6P3zEoRv21LRzf/hEKuQtoqbelgIu3XxfwHXkM1uNvqCY+o3dYFDR1w6NY4q+4DWt00hBfPQli3/4UOxE/pFmDmIwTjE+EHDXplaGEG6JkxHOwnO34dbu4y8l3so66bPjLQwVx1sleVPacw8n3joSlg823irLnkkAeX4Qdw/41kFud4px3rHmqbopxnkPHelqMY7EPFsUD2RaBjxiInt8Y3ieMajvp5GYApMBYXCF8OkQ5n1x5RCGYje9WbqPg8Exqs7O0X66OLVXUj8t9P5cDS2iXG503RSxnSXpuCD55AGKY+kxZUiUPCbdLTsfSWopsgkuFsYYybEJrHjQColBlAyb0KaaZhbsAmrVlsFOvpHIpw1iFN8LZoCGQduZ++PWcNi02RKyaVBnfUjuNYh/jVKT0UUnzw1+Pfpd9OYBq/7WcX/Nt3Z4FwZhdDDTFvp6q6avt4COpdjWfvix/f5cF4OskmkrWdFTxJfUrlRr/mj/madoaNlwSprauAhaol3MFLRDRVizp1az3L5o8JmQNty5AgCUjA+wSVrD5zO9bk4HNiwuHygnetkP0W1KK2hR12I4OgTauQxm0ZQ4PFjxWg9dnM0SxckjmwI0AoaANQxhmKAlhihqXR1DiDNCrgzxDoYoYpUfFHwHB1RX1DboxSRXR3MGlCNer/MJEMf77bgEN+oQ39b0gpEgvsonQCwJkncKjFZ8AmTZU5vLwbXNEGLqbDR5EL1ubkIv8yCNlu9c8yADyYPogMroxLVmdSlZzZ6alni5RzkRLCYFtxspjITfaudmDC0vgtuZutE1DV0G02hqfCBbuQ+UTVEaZWoE1038GFxqBEteV3EliYMSoUWbDXIkYbZCEtCkJMG51G2ThDi8MppACVcvz+hnoITL8iXXQGmogRLS2N5O7bARdVlMM3dZb8RMFxUolSxDYYHSKNitLg00vDCppUUqVw+IkYEaD8hS7gEZYjJlRGFSXS5lcGGSIXf7i0uHNTCLQ7WIhhgWB7Cm2AV2fV1tg1X0bkcTrhi1W0VgACR34QrwKM7o+GO5WifixqxUkElRm3EShb8IJ/iZHwRcUXOtl20IVAb4s/YEAojDUcmeQEYJJSDtuB7P2hLIkLvQoHecaEnkxJK62uZE0e3dOjCj4MTqOf895URTdElHhUdbIh5L6moZj9k26pex16BqRJrVs9alIhKpQyQcNSLZnAlZiCyrq21EijFfh7vRKEckHCQi5c4E7x0igT01uVpORmRJXW0jsmQG93hmMJnVs7j7ikgxivy6ToYdypvgwkJ5S3Q+h0yLJubkf+qGeaaQJ1W7pCXziMYZNFjVKOspIVrjGmoQsMj/UODJWFT8i4OW6FqOKFywFA4zKMSi3GVkvcMivw/NyVhUvKGNVTqDJ1nHjwHxOvnxPuV4rJ7HIxWPujo8lq7ncp6Zl758ildlEwjTqKH9H+3gvXpc4tXrJeDld2+U5tVnoLtIaWFuNbgBW5MWPY3CMMmbIm3R4iH0GOI//g8=&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><rect x="146" y="0" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 30px; margin-left: 147px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>(bcd)</div><div>counter</div></div></div></div></foreignObject><text x="206" y="34" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(bcd)...</text></switch></g><rect x="146" y="110" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 140px; margin-left: 147px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>ssd1306 master</div><div>logic</div></div></div></div></foreignObject><text x="206" y="144" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">ssd1306 master...</text></switch></g><rect x="146" y="220" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 250px; margin-left: 147px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">i2c master</div></div></div></foreignObject><text x="206" y="254" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">i2c master</text></switch></g><rect x="382" y="270" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 300px; margin-left: 383px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">open drain buffer</div></div></div></foreignObject><text x="442" y="304" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">open drain buffer</text></switch></g><rect x="382" y="50" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 80px; margin-left: 383px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">metastability filter</div></div></div></foreignObject><text x="442" y="84" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">metastability filter</text></switch></g><path d="M 206 60 L 206 103.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 206 108.88 L 202.5 101.88 L 206 103.63 L 209.5 101.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 77px; margin-left: 206px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">count</div></div></div></foreignObject><text x="206" y="80" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">count</text></switch></g><path d="M 206 213.63 L 206 176.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 206 218.88 L 202.5 211.88 L 206 213.63 L 209.5 211.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 206 171.12 L 209.5 178.12 L 206 176.37 L 202.5 178.12 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 193px; margin-left: 208px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">ctrl, data, errors</div></div></div></foreignObject><text x="208" y="197" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">ctrl, data, errors</text></switch></g><path d="M 362 299.8 L 302 300 L 362 299.8 L 382 299.8" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 292px; margin-left: 353px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">sda_enable</div></div></div></foreignObject><text x="353" y="296" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sda_enable</text></switch></g><path d="M 502 299.8 L 522 299.8" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 290px; margin-left: 523px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"><div>sda</div></div></div></div></foreignObject><text x="523" y="293" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sda</text></switch></g><path d="M 442 330 L 442 350" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 340px; margin-left: 472px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">sda_pad</div></div></div></foreignObject><text x="472" y="343" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sda_pad</text></switch></g><rect x="382" y="180" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 210px; margin-left: 383px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">open drain buffer</div></div></div></foreignObject><text x="442" y="214" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">open drain buffer</text></switch></g><path d="M 362 209.8 L 302 210 L 362 209.8 L 382 209.8" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 202px; margin-left: 353px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">scl_enable</div></div></div></foreignObject><text x="353" y="206" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">scl_enable</text></switch></g><path d="M 502 209.8 L 522 209.8" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 200px; margin-left: 523px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">scl</div></div></div></foreignObject><text x="523" y="203" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">scl</text></switch></g><path d="M 442 240 L 442 260" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 250px; margin-left: 472px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">scl_pad</div></div></div></foreignObject><text x="472" y="253" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">scl_pad</text></switch></g><path d="M 382 80 L 362 80" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 70px; margin-left: 367px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">rst</div></div></div></foreignObject><text x="367" y="74" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">rst</text></switch></g><path d="M 502 80 L 522 80" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 70px; margin-left: 532px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">sync_rst</div></div></div></foreignObject><text x="532" y="74" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sync_rst</text></switch></g><path d="M 302 300 L 302 210" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 266 250 L 302 250" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 146 230.3 L 120.16 230" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 230px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">clk_i</div></div></div></foreignObject><text x="101" y="234" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">clk_i</text></switch></g><path d="M 146 250.15 L 120.16 249.85" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 250px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"><div><br /></div><div><br /></div></div></div></div></foreignObject><text x="101" y="253" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">&#xa;</text></switch></g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 250px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">sda</div></div></div></foreignObject><text x="101" y="254" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sda</text></switch></g><path d="M 146 240.3 L 120.16 240" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 240px; margin-left: 102px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">rst_in</div></div></div></foreignObject><text x="102" y="244" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">rst_in</text></switch></g><path d="M 146 260 L 120 260" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 260px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">scl</div></div></div></foreignObject><text x="101" y="264" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">scl</text></switch></g><path d="M 146 130.23 L 120.16 129.93" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 130px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">clk_i</div></div></div></foreignObject><text x="101" y="134" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">clk_i</text></switch></g><path d="M 146 150.08 L 120.16 149.78" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 150px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"><div><br /></div><div><br /></div></div></div></div></foreignObject><text x="101" y="153" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">&#xa;</text></switch></g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 150px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">start_i</div></div></div></foreignObject><text x="101" y="153" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">start_i</text></switch></g><path d="M 146 140.23 L 120.16 139.93" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 140px; margin-left: 102px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">rst_in</div></div></div></foreignObject><text x="102" y="144" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">rst_in</text></switch></g><path d="M 146 20.22 L 120.16 19.92" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 20px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">clk_i</div></div></div></foreignObject><text x="101" y="24" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">clk_i</text></switch></g><path d="M 146 40.07 L 120.16 39.77" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 40px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"><div><br /></div><div><br /></div></div></div></div></foreignObject><text x="101" y="43" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">&#xa;</text></switch></g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 40px; margin-left: 101px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">start</div></div></div></foreignObject><text x="101" y="43" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">start</text></switch></g><path d="M 146 30.22 L 120.16 29.92" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 30px; margin-left: 102px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">rst_in</div></div></div></foreignObject><text x="102" y="34" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">rst_in</text></switch></g><path d="M 50 119.82 L 70 119.82" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 120px; margin-left: 30px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">clk_i</div></div></div></foreignObject><text x="30" y="123" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">clk_i</text></switch></g><rect x="10" y="80" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 95px; margin-left: 11px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Inputs</div></div></div></foreignObject><text x="40" y="99" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Inputs</text></switch></g><path d="M 50 129.82 L 70 129.82" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 130px; margin-left: 30px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">rst_i</div></div></div></foreignObject><text x="30" y="133" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">rst_i</text></switch></g><path d="M 50 139.82 L 70 139.82" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 140px; margin-left: 20px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">sda_pad</div></div></div></foreignObject><text x="20" y="143" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sda_pad</text></switch></g><path d="M 50 149.82 L 70 149.82" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 150px; margin-left: 20px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">scl_pad</div></div></div></foreignObject><text x="20" y="153" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">scl_pad</text></switch></g><path d="M 50 159.71 L 70 159.71" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 160px; margin-left: 20px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">start_i</div></div></div></foreignObject><text x="20" y="163" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">start_i</text></switch></g><rect x="590" y="80" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 95px; margin-left: 591px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Outputs</div></div></div></foreignObject><text x="620" y="99" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Outputs</text></switch></g><path d="M 630 110 L 650 110" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 110px; margin-left: 600px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">sda_pad</div></div></div></foreignObject><text x="600" y="114" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">sda_pad</text></switch></g><path d="M 630 120 L 650 120" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 120px; margin-left: 600px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">scl_pad</div></div></div></foreignObject><text x="600" y="124" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">scl_pad</text></switch></g><path d="M 630 130 L 650 130" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 130px; margin-left: 590px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">status_leds</div></div></div></foreignObject><text x="590" y="134" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">status_leds</text></switch></g><rect x="590" y="280" width="40" height="40" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 38px; height: 1px; padding-top: 287px; margin-left: 592px;"><div style="box-sizing: border-box; font-size: 0px; text-align: left;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"> </div></div></div></foreignObject><text x="592" y="299" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"> </text></switch></g><rect x="420" y="360" width="40" height="40" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 38px; height: 1px; padding-top: 367px; margin-left: 422px;"><div style="box-sizing: border-box; font-size: 0px; text-align: left;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"> </div></div></div></foreignObject><text x="422" y="379" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"> </text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file

M doc/index.md => doc/index.md +180 -94
@@ 9,7 9,7 @@ defaults:
csl: bib.csl
references:
  - type: incollection
    id: i2c
    id: i2c-spec
    title: "I2C-bus specification and user manual"
    author: "NXP"
    URL: https://www.nxp.com/docs/en/user-guide/UM10204.pdf


@@ 25,6 25,8 @@ header-includes:
- |
  ```{=latex}
  \usepackage{awesomebox}
  \usepackage{pdflscape}
  \usepackage{rotating}
  ```
pandoc-latex-environment:
  noteblock: [note]


@@ 41,7 43,7 @@ and not only in simulation. The master will be tested by showing three
numbers as a counter on SSD1306 with I2C interface.

I2C might be used for communication with multiple devices. It supports
up to 3.4 Mbps speeds (High-speed mode). [-@i2c]
up to 3.4 Mbps speeds (High-speed mode). [-@i2c-spec]
That is sufficient for many applications. 
I2C is used often, most microcontrollers include
I2C hardware support as well.


@@ 82,6 84,26 @@ Inputs have ``_i`` suffix, whereas outputs have ``_o`` suffix.
When an input or output is active low, it's suffix will include ``n`` at the end.
:::

## Simulation

For simulating, [VUnit](https://vunit.github.io/) framework has been used.
It comes with a Python library that makes it easy to run the testbenches.
The starting script is located in the root of the project, and called ``run.py``.
It also comes with a VHDL library that adds some enhancements for the testing and
communication with the Python side.

All non-trivial entities were tested in simulation with various use cases.
Every entity was tested by itself, and then, tests of the top level entities were performed
as well. RTL I2C master has been tested by having a simple behavioral I2C slave implemented.
RTL I2C slave by having simple I2C master implemented.

All of the tests are checking if the result is correct by themselves. It's thus not required
to go into the waves and check as a person. This means it's possible to make some changes,
and check whether the changes have broken something very fast.

The libraries for simulation include ``_tb`` suffix. There is a testbench library for every
design library.

## SSD1306 display counter
The SSD1306 display is a 128x64 display
that supports various interfacing methods such as I2C.


@@ 99,15 121,34 @@ on the master device.

See the following figure showing the setup with Basys 3 board with SSD1306 counter entity
connected to the SSD1306.

![Basys 3 board connected to SSD1306 display with a counter running](./img/fpga-board-ssd1306.jpg)

The top level entity consists of three main entities. One of those is for a BCD counter,
another for FSM for accessing the SSD1306 display, and the last for I2C master.
another for FSM for controlling the SSD1306 display, and data that are being sent to it,
and the last for I2C master.

There are also three supporting entities, two open drain buffers
for ``scl`` and ``sda``. The last one is for treating metastability of the
reset.

The following page shows the diagram of the top level entity for SSD1306 counter
exported from Vivado.

\pagenumbering{gobble}
\begin{landscape}
\begin{sidewaysfigure}[ht]
\centering

\hspace*{-5cm}
\vspace{-3cm}
\includegraphics[angle=180, width=850pt, trim=-5cm 0 0 -5cm]{./img/ssd1306_counter_schematic.pdf}
\caption{SSD1306 counter top level diagram}

\end{sidewaysfigure}
\end{landscape}
\pagenumbering{arabic}

## I2C
The implementation consists of two separate top level entities,
one of those is used for master entity and the other for slave entity.


@@ 118,13 159,13 @@ Having these set to high means the line should be pulled down. There is also ``s
An ``open_drain_buffer`` entity should be used
to connect the input and enable output to the actual pad.

Both master and slave entities share the rx and tx data interfaces.
Both ``master`` and ``slave`` entities share the ``rx`` and ``tx`` data interfaces.
The difference is that master has signals for requesting a new transaction,
but the slave waits for a start condition to start receiving/transmitting.

### Entity ``master``
The master entity is a top level entity for using the I2C
core as a master. It connects all of the blocks for functioning
core as a master. It connects all of the blocks for a functioning
I2C master.

The entity has three control inputs ``start``, ``stop``, and ``run``.


@@ 142,77 183,94 @@ for instance, via generic argument. The generator always makes sure the

Table: Ports of ``master`` entity

| **Name**            | **Type**            | **Description**                                                    |
|---------------------|---------------------|--------------------------------------------------------------------|
| clk_i               | std_logic           | Clock input                                                        |
| rst_in              | std_logic           | Asynchronous reset (active low)                                    |
| slave_address_i     | std_logic_vector[7] | Address of the slave to choose                                     |
| generate_ack_i      | std_logic           | Whether to generate acknowledges on received data                  |
| expect_ack_i        | std_logic           | Whether to expect acknowledges on transmitted data                 |
| rx_valid_o          | std_logic           | ``rx_data`` are valid                                              |
| rx_data_o           | std_logic_vector[8] | Received data                                                      |
| rx_confirm_i        | std_logic           | Confirm read of ``rx_data`` to fill with next data                 |
| tx_ready_o          | std_logic           | ``tx_data`` may be received                                        |
| tx_valid_i          | std_logic           | ``tx_data`` are valid                                              |
| tx_data_i           | std_logic_vector[8] | Data to transmit                                                   |
| tx_clear_buffer_i   | std_logic           | Clear transmit buffer (clear data that weren't sent)               |
| err_noack_data_o    | std_logic           | Got NACK when transmitting                                         |
| err_noack_address_o | std_logic           | Got NACK on first byte with address                                |
| err_arbitration_o   | std_logic           | Got unexpected value on ``sda``                                    |
| err_general_o       | std_logic           | Other errors, such as getting start condition unexpectedly         |
| stop_i              | std_logic           | Generate stop condition when possible                              |
| start_i             | std_logic           | Generate start condition when possible                             |
| run_i               | std_logic           |                                                                    |
| rw_i                | std_logic           | Read or write transaction (R = 1)                                  |
| dev_busy_o          | std_logic           | Master device is currently busy                                    |
| bus_busy_o          | std_logic           | Bus is busy (but master is not)                                    |
| waiting_o           | std_logic           | Waiting for data on transmit or for read on receive if buffer full |
| sda_i               | std_logic           | I2C ``sda`` line                                                   |
| scl_i               | std_logic           | I2C ``scl`` line                                                   |
| sda_enable_o        | std_logic           | Pull ``sda`` low                                                   |
| scl_enable_o        | std_logic           | Pull ``scl`` low                                                   |
| **Name**            | **Type**            | **Description**                                    |
|------------------------|---------------------|----------------------------------------------------|
| clk_i               | std_logic           | Clock input                                        |
| rst_in              | std_logic           | Asynchronous reset (active low)                    |
| slave_address_i     | std_logic_vector[7] | Address of the slave to choose                     |
| generate_ack_i      | std_logic           | Whether to generate acknowledges on received data  |
| expect_ack_i        | std_logic           | Whether to expect acknowledges on transmitted data |
| rx_valid_o          | std_logic           | ``rx_data`` are valid                              |
| rx_data_o           | std_logic_vector[8] | Received data                                      |
| rx_confirm_i        | std_logic           | Confirm read of ``rx_data`` to receive next        |
| tx_ready_o          | std_logic           | ``tx_data`` may be received                        |
| tx_valid_i          | std_logic           | ``tx_data`` are valid                              |
| tx_data_i           | std_logic_vector[8] | Data to transmit                                   |
| tx_clear_buffer_i   | std_logic           | Clear transmit buffer (unsent data)                |
| err_noack_data_o    | std_logic           | Got NACK when transmitting                         |
| err_noack_address_o | std_logic           | Got NACK on first byte with address                |
| err_arbitration_o   | std_logic           | Got unexpected value on ``sda``                    |
| err_general_o       | std_logic           | Other errors, like unexpected start cond           |
| stop_i              | std_logic           | Generate stop condition when possible              |
| start_i             | std_logic           | Generate start condition when possible             |
| run_i               | std_logic           |                                                    |
| rw_i                | std_logic           | Read or write transaction (R = 1)                  |
| dev_busy_o          | std_logic           | Master device is currently busy                    |
| bus_busy_o          | std_logic           | Bus is busy (but master is not)                    |
| waiting_o           | std_logic           | Waiting for data on transmit or for read confirm   |
| sda_i               | std_logic           | I2C ``sda`` line                                   |
| scl_i               | std_logic           | I2C ``scl`` line                                   |
| sda_enable_o        | std_logic           | Pull ``sda`` low                                   |
| scl_enable_o        | std_logic           | Pull ``scl`` low                                   |

Table: Generic arguments of ``master`` entity

| **Name**              | **Type** | **Default value**                           |
|-----------------------|----------|---------------------------------------------|
| SCL_FALLING_DELAY     | natural  | How many clock cycles to wait               |
|                       |          | after scl falling to set ``sda``            |
| SCL_MIN_STABLE_CYCLES | natural  | Minimum clock cycles to keep ``scl`` stable |
| **Name**                    | **Type** | **Default value**                           |
|-----------------------------|----------|---------------------------------------------|
| SCL_FALLING_DELAY           | natural  | How many clock cycles to wait               |
|                             |          | after scl falling to set ``sda``            |
| SCL_MIN_STABLE_CYCLES       | natural  | Minimum clock cycles to keep ``scl`` stable |

The following page contains the diagram of the I2C ``master`` entity
along with all components.

\pagenumbering{gobble}
\begin{landscape}
\begin{sidewaysfigure}[ht]
\centering

\hspace*{-5cm}
\vspace{2cm}
\includegraphics[angle=180, width=700pt, trim=0 0 0 0]{./img/i2c_master_schematic.pdf}
\caption{SSD1306 counter top level diagram}

\end{sidewaysfigure}
\end{landscape}
\pagenumbering{arabic}

### Entity ``slave``
Slave entity is a top level for I2C slave.

It outputs the current state upon receiving _commands_ from the master.
It outputs the current state (such as bus busy, device busy, r/w) upon receiving _commands_ from the master.

Table: Ports of ``slave`` entity

| **Name**          | **Type**            | **Description**                                                    |
|-------------------|---------------------|--------------------------------------------------------------------|
| clk_i             | std_logic           | Clock input                                                        |
| rst_in            | std_logic           | Asynchronous reset (active low)                                    |
| address_i         | std_logic_vector[7] | Address of the slave                                               |
| generate_ack_i    | std_logic           | Whether to generate ack on every read                              |
| expect_ack_i      | std_logic           | Whether to expect acknowledges on transmitted data                 |
| rx_valid_o        | std_logic           | ``rx_data`` are valid                                              |
| rx_data_o         | std_logic_vector[8] | Received data                                                      |
| rx_confirm_i      | std_logic           | Confirm data of ``rx_data`` to fill with next data                 |
| rx_stretch_i      | std_logic           | Allow stretching on receiving (when read buffer full)              |
| tx_ready_o        | std_logic           | ``tx_data`` may be received                                        |
| tx_valid_i        | std_logic           | ``tx_data`` are valid                                              |
| tx_data_i         | std_logic_vector[8] | Data to transmit                                                   |
| tx_stretch_i      | std_logic           | Allow stretching on transmitting (when data missing)               |
| tx_clear_buffer_i | std_logic           | Clear transmit buffer (clear data that weren't sent)               |
| err_noack_o       | std_logic           | Got NACK when transmitting                                         |
| err_sda_o         | std_logic           | Got unexpected value on ``sda``                                    |
| rw_o              | std_logic           | Read or write transaction (R = 1)                                  |
| dev_busy_o        | std_logic           | Master device is currently busy                                    |
| bus_busy_o        | std_logic           | Bus is busy (but master is not)                                    |
| waiting_o         | std_logic           | Waiting for data on transmit or for read on receive if buffer full |
| sda_i             | std_logic           | I2C ``sda`` line                                                   |
| scl_i             | std_logic           | I2C ``scl`` line                                                   |
| sda_enable_o      | std_logic           | Pull ``sda`` low                                                   |
| scl_enable_o      | std_logic           | Pull ``scl`` low                                                   |
| **Name**          | **Type**            | **Description**                                    |
|-------------------|---------------------|----------------------------------------------------|
| clk_i             | std_logic           | Clock input                                        |
| rst_in            | std_logic           | Asynchronous reset (active low)                    |
| address_i         | std_logic_vector[7] | Address of the slave                               |
| generate_ack_i    | std_logic           | Whether to generate ack on every read              |
| expect_ack_i      | std_logic           | Whether to expect acknowledges on transmitted data |
| rx_valid_o        | std_logic           | ``rx_data`` are valid                              |
| rx_data_o         | std_logic_vector[8] | Received data                                      |
| rx_confirm_i      | std_logic           | Confirm data of ``rx_data`` to receive next        |
| rx_stretch_i      | std_logic           | Allow stretching when buffer full                  |
| tx_ready_o        | std_logic           | ``tx_data`` may be received                        |
| tx_valid_i        | std_logic           | ``tx_data`` are valid                              |
| tx_data_i         | std_logic_vector[8] | Data to transmit                                   |
| tx_stretch_i      | std_logic           | Allow stretching on transmitting (no data)         |
| tx_clear_buffer_i | std_logic           | Clear transmit buffer (unsent data)                |
| err_noack_o       | std_logic           | Got NACK when transmitting                         |
| err_sda_o         | std_logic           | Got unexpected value on ``sda``                    |
| rw_o              | std_logic           | Read or write transaction (R = 1)                  |
| dev_busy_o        | std_logic           | Master device is currently busy                    |
| bus_busy_o        | std_logic           | Bus is busy (but master is not)                    |
| waiting_o         | std_logic           | Waiting for data on transmit or for read confirm   |
| sda_i             | std_logic           | I2C ``sda`` line                                   |
| scl_i             | std_logic           | I2C ``scl`` line                                   |
| sda_enable_o      | std_logic           | Pull ``sda`` low                                   |
| scl_enable_o      | std_logic           | Pull ``scl`` low                                   |

Table: Generic arguments of ``slave`` entity



@@ 221,9 279,26 @@ Table: Generic arguments of ``slave`` entity
| SCL_FALLING_DELAY | natural  | How many clock cycles to wait after |
|                   |          | scl falling to set ``sda``          |

The following page contains the diagram of the I2C ``slave`` entity
along with all components.

\pagenumbering{gobble}
\begin{landscape}
\begin{sidewaysfigure}[ht]
\centering

\hspace*{-5cm}
\vspace{2cm}
\includegraphics[angle=180, width=700pt, trim=0 0 0 0]{./img/i2c_slave_schematic.pdf}
\caption{SSD1306 counter top level diagram}

\end{sidewaysfigure}
\end{landscape}
\pagenumbering{arabic}

### Common
All of the blocks responsible for receiving or sending data
should get the``scl`` state from the input going to the FPGA/ASIC,
should get the ``scl`` state from the input going to the FPGA/ASIC,
the same goes for ``sda``.
This makes sure that features such as scl stretching or arbitration
are supported. If scl from ``scl_generator`` were to be used, there


@@ 231,16 306,19 @@ would be no possibility to detect either one of those.

:::note
Some of the entities accept delayed falling pulse of ``scl``.
This is to make sure ``sda`` is changed AFTER ``scl`` is indeed
low. If ``sda`` was changed right away, it's possible there would
This is to make sure ``sda`` is changed after ``scl`` is indeed
low. If ``sda`` were to be changed right away, it's possible there would
be a device that would detect start or stop condition when
there is no condition.
there is actually no condition.
:::

#### Entity ``address_generator``
Address generator is responsible for sending
address upon requested. It's used in the I2C master
address when requested. It's used in the I2C master
to select a slave. Currently it supports only 7 bit addresses.
It checks ACK as well, and outputs ``noack_o`` for NACK.
It also checks the ``sda`` level when sending to detect
arbitration loss.

Table: Ports of ``address_generator`` entity



@@ 265,6 343,7 @@ Table: Ports of ``address_generator`` entity
Address detector looks at the received data to check
if the address matches the address of the slave.
Currently it supports only 7 bit addresses.
It supports sending ACK after address received.

Table: Ports of ``address_detector`` entity



@@ 291,13 370,16 @@ what ``address_detector`` is for.

The entity supports ``scl`` stretching. When the data are not yet
read (that should be signaled by ``confirm_read_i``), it will stretch
the ``scl`` to prevent loss of data.
the ``scl`` to prevent loss of data. The data are stored in a separate buffer
when full data are received. This makes it possible to start receiving next byte
immediately without having to wait for read from another entity. However, if the
receive buffer gets full with second byte, there is need for the stretching.
For master, this means ``scl`` is not generated, for slave it
means it's held down even though the master is trying to let go
to get high level.

The entity is also responsible for acknowledging the received data.
All data are acknowledged.
The entity is also responsible for acknowledging the received data when
``generate_ack_i`` is set.

Table: Ports of ``rx`` entity



@@ 320,20 402,20 @@ Table: Ports of ``rx`` entity
| confirm_read_i        | std_logic           | Confirm data were read               |

#### Entity ``tx``
Receiver entity is responsible for transmitting data to the
Transmitter entity is responsible for transmitting data to the
data bit line (``sda``), and for storing the data to be sent next.
It's not meant to be used as generator/sender of the address, that is
what ``address_generator`` is for.

The entity supports ``scl`` stretching. When there are not any
data to be sent delivered yet, it will stretch
the ``scl`` to prevent loss of data.
the ``scl``.
For master, this means ``scl`` is not generated, for slave it
means it's held down even though the master is trying to let go
to get high level.

If wrong level is detected on the ``sda`` upon rising edge of ``scl``,
the entity signals 
the entity signals that in ``unexpected_sda_o``.

The entity is also responsible for verifying acknowledge at the right time,
and signaling that no acknowledge has been received.


@@ 361,10 443,13 @@ Table: Ports of ``tx`` entity

#### Entity ``scl_generator``
Scl generator generates the ``scl`` while making sure
to keep the signal high or low for at least specified number of cycles.
to keep the signal high or low (stable) for at least specified number of cycles.
It may send a signal when the ``scl`` cannot be set to high level,
that could signal a slave pulling down the line.

It supports single requests for falling or rising edges (used for startstop condition generation)
as well as continuous (used for transmit/receive).

Table: Ports of ``scl_generator`` entity

| **Name**         | **Type**  | **Description**                   |


@@ 384,7 469,7 @@ Table: Generic arguments of ``scl_generator`` entity

| **Name**          | **Type** | **Description**                |
|-------------------|----------|--------------------------------|
| MIN_STABLE_CYCLES | natural  | How many clock cycles to keep ``scl`` on stable |
| MIN_STABLE_CYCLES | natural  | How many clock cycles to keep ``scl`` stable |

#### Entity ``startstop_condition_detector``
This entity detects either start or stop condition.


@@ 443,19 528,20 @@ Table: Ports of ``startstop_condition_generator`` entity
This entity is a FSM for the ``master`` entity.
It commands what should be done, such as generating
the address, receiving data, transmitting data, etc.
It also detects errors and in case of one, outputs it.
It also decides when to go to error state, and outputs an error
that is propagated through the ``master`` entity.
The errors are cleared upon next start request so that
it might be validated if there has been a new error for the
start request.

Inputs and outputs from other entities, should be explained by other entities well already.


#### Entity ``slave_state`` 
This entity is a FSM for the ``slave`` entity.
It commands what should be done, such as detecting
the address, receiving data, transmitting data, etc.
It also detects errors and in case of one, outputs it.
It also decides when to go to error state, and outputs an error
that is propagated through the ``slave`` entity.
The errors are cleared upon next start condition.

Inputs and outputs from other entities, should be explained by other entities well already.


@@ 476,19 562,20 @@ Inputs and outputs from other entities, should be explained by other entities we

# Conclusion
Both master and slave have been verified to be working in simulation and on an FPGA board.
All found issues were found, and when the issues were found on the FPGA, but not in simulation,
a new testcase has been added to make sure the behavior is verified if there were any changes made.
All found issues were solved, and when the issues were found on the FPGA, but not in simulation,
a new testcase has been added to make sure the behavior is verified again if there were any changes made.

The components correctly monitor the bus even when they are not being used,
and output if the bus is busy or not. There are errors reported
in case something went wrong (cannot set ``sda``, arbitration lost, etc.).
in case something went wrong (wrong ``sda`` level, arbitration lost, etc.).
This should make the I2C components usable in real applications even if more masters
are incorporated on the bus.

There are some things that could be added or changed in the future, such as:

- 10 bit addressing support
- More error states (timeout)
- Multiple possible ``scl`` frequencies
- Multiple possible ``scl`` frequencies switchable after synthesis
- Adding behavioral I2C master and I2C slave modules for simulation

The 10 bit addressing is not currently supported, although its support should not be hard


@@ 498,22 585,21 @@ is received instead of the first one.

So far if the scl generator entity detects an error (that it cannot get the line high),
it will produce a signal to say that, but this signal is not utilized in the FSM entity
for the master. That means if the line stays low indefinitely, the master will become stuck
without notifying the application about a possible problem. One of the slave devices could
be erroneously holding down the line.
for the master. That means if the line stays low indefinitely (possibly due to a failing slave device),
the master will become stuck without notifying the application about a possible problem.

The ``master`` entity supports only one frequency for ``scl`` for now.
That could be changed by passing in an array of values instead of one generic argument.
Then it could be chosen by index, and changed in runtime when the index would be set
as an input port.
That could be changed by passing in an array of values instead of one generic argument
for saying how many cycles to keep ``scl`` stable.
Then it could be chosen by an input port that would act as an index.

The simulation currently uses blocking procedures for testing.
These procedures are called from the top level simulation entities.
This makes it hard to test some of the features such as verifying whether
error signal became high at the correct``scl`` edge.
error signal became high at the correct ``scl`` edge.
It's also quite hard to test having multiple devices on the bus sending data simultaneously.
That could come in handy to test arbitration.
Both of these could be overcome by adding i2c behavioral modules, and instead of generating
Both of these could be overcome by adding I2C behavioral modules, and instead of generating
the ``scl`` and ``sda`` from the top level testing entity, they would be generated
by these behavioral models.
The top level entity would just notify the behavioral models to start generating or expect the