Sorry I came in late for this one.
I'm still quite new to VHDL external names. But I thought this is already possible with VHDL-2008?
The simulatedUartTransmitter just looks like a package to me, with a few procedures:
library ieee; use ieee.std_logic_1164.all; package uartPkg is type simulatedUartTransmitter is protected procedure setBitTime(newBitTime:in time); procedure sendChar(char:in character); end protected simulatedUartTransmitter; signal TxD:std_ulogic; shared variable uartTx: simulatedUartTransmitter; end package uartPkg;
package body uartPkg is type simulatedUartTransmitter is protected body variable bitTime:time; procedure setBitTime(newBitTime:in time) is begin bitTime:=newBitTime; end procedure setBitTime; procedure sendChar(char:in character) is begin /* use wait statements to wait on bitTime. */ ... end procedure sendChar; end protected body simulatedUartTransmitter; end package body uartPkg;
/* The testbench. */ library ieee; use ieee.std_logic_1164.all; entity justTryThisOne is end entity justTryThisOne;
architecture noTestbenchInst of justTryThisOne is signal serial_TxD: std_ulogic; alias txGenerator is ;
begin tester: process is begin txGenerator.setBitTime(104000); wait for 1 us; txGenerator.sendChar('h'); txGenerator.sendChar('i'); txGenerator.sendChar('!'); wait for 1 us; end process tester; end architecture noTestbenchInst;
I haven't tried this with any simulator, but it might just work.
regards, daniel
--------------------------------------- Posted through