Verilog-AMS defines hierarchical parameters $xposition
and $yposition
as well as $angle
to express physical location and orientation as on a wafer or PCB. According to the LRM, $angle
is supposed to mean “counter-clockwise”.
Our interpretation of counter-clockwise follows when choosing the x axis pointing to the right, and the y axis pointing upwards. Now a 90 degree rotation moves the x axis to the y axis, in other words (x,y)=(1,0)
to (0,1)
. Equivalently, the y axis may be thought of as the imaginary axis in the complex plane. Then, rotation by 2\pi\phi corresponds to multiplication by exp(2\pi\phi * i), with the imaginary unit i.
This seems relevant when moving on to schematics. Since Verilog-AMS is governed by physical semantics, we retain this choice of angle and coordinates also for schematic drawings, even though other coordinate systems are in common use.
If you prefer a y axis pointing downwards, you may use a flipped coordinate system locally, as within the body of the following module.
As expected, any uses of angle
inside the body will be applied before the final vflip.
(* S0_vflip=-1 *) module upside_down_module(); [..] endmodule
(todo)