Search code examples
dml-lang

Forward access to bank set method in dml 1.4


I am migrating some code to dml 1.4. Old code used the miss_bank parameter to handle miss read and writes and forward them to some other bank:

dml 1.2;
bank main_bank {
 parameter miss_bank = $dev.forwrad_bank;
}

bank forward_bank {
 // structure here
}

However the miss bank parameter is now deprecated in dml 1.4 so I have been trying to workaround this issue and get the same or similar behavior.

For this I overridden the io_access_memory function of my main_bank as follows

    method io_memory_access(generic_transaction_t *memop, uint64 offset, void *aux_p) -> (bool) {
        local bool success = default(memop,offset,aux_p);
        if (!success){
        log info,4:"Fowarding access to: %s", forward_bank.qname;
            success = forward_bank.io_memory_access(memop,offset,aux_p);
        }
        return success;
    }

This works fine for write/read access when there is a miss bank access they are forwarded to the specified bank. However I have noticed this does not work for set inquiry access. I get a log that says, for example "Unmapped inquiry write at 0xdeadbeef" but access is not forwarded to the next bank, seems like the default function returns true anyways.

Is this no longer supported in dml 1.4 and if so how could I work around this?


Solution

  • Unfortunately currently, the default() implementation that you call will return True for all inquiry accesses. As you note, that means you cannot apply this to missed registers in any easy way.

    If you just want to forward everything and there are no unique registers in forward you can skip calling default, but then the bank is rather pointless as you could just as well map the forward_bank object twice. So I assume that is not the case.