Verilog/AMS is a superset of the Verilog digital HDL, so all statements in digital domain work as in
Verilog (see there for examples). All analog parts work as in
Verilog-A. The following code example in Verilog-AMS shows a
DAC which is an example for analog processing which is triggered by a digital signal: `include "constants.vams" `include "disciplines.vams" // Simple DAC model module dac_simple(aout, clk, din, vref); // Parameters parameter integer bits = 4 from [1:24]; parameter integer td = 1n from[0:inf); // Processing delay of the DAC // Define input/output input clk, vref; input [bits-1:0] din; output aout; // Define port types logic clk; logic [bits-1:0] din; electrical aout, vref; // Internal variables real aout_new, ref; integer i; // Change signal in the analog part analog begin @(posedge clk) begin // Change output only for rising clock edge aout_new = 0; ref = V(vref); for(i=0; i The
ADC model is reading analog signals in the digital blocks: `include "constants.vams" `include "disciplines.vams" // Simple ADC model module adc_simple(clk, dout, vref, vin); // Parameters parameter integer bits = 4 from[1:24]; // Number of bits parameter integer td = 1 from[0:inf); // Processing delay of the ADC // Define input/output input clk, vin, vref; output [bits-1:0] dout; // Define port types electrical vref, vin; logic clk; reg [bits-1:0] dout; // Internal variables real ref, sample; integer i; initial begin dout = 0; end // Perform sampling in the digital blocks for rising clock edge always @(posedge clk) begin sample = V(vin); ref = V(vref); for(i=0; i ref) begin dout[i] ==Implementations==