digraph rom_sd {
    Reset [shape = doublecircle, label = "RESET\nbuffer_half = 0\nrom_addr = 0\nrom_enable = 1\nbuffer.addra=0\nready=0"];
    node [shape = circle];
    Delay [label="DELAY\nrom_addr++"];
    WriteBuf [label="WRITEBUF\nbuffer.ena=1\nbuffer.dina=rom_data\nbuffer.addra++\nrom_addr++"];
    EndWrite [label="ENDWRITE\nbuffer.ena=1\nbuffer.data=rom_data\nbuffer.addra++\nready=1"];
    Wait [label = "WAIT\nbuffer.ena=0"];

    Reset -> Reset [label="reset"];
    Reset -> Delay [label="!reset"];

    Delay -> WriteBuf;

    WriteBuf -> WriteBuf [label="buffer.addra < 1023"]
    WriteBuf -> EndWrite [label="buffer.addra == 1023"]

    EndWrite -> Wait;

    Wait -> Wait [label = "buffer_half == buffer.address_half"]
    Wait -> Delay [label = "buffer_half != buffer.address_half"]


}
