| With the development of computer technology,the function of electronic circuit simulation software is gradually mature and perfect,which brings great convenience to the design of electronic circuits.In the post-Moore era,chips have become smaller and smaller,but they can integrate more and more functions.And electronic circuit simulation software is known as the mother of the chip.But now the mainstream electronic circuit simulation software such as SPECTRE and HSPICE are all developed by American companies.After decades of technological development and mergers and acquisitions,the development of domestic electronic circuit simulation software has lagged far behind that of foreign countries,which makes the status of electronic circuit simulation software in China no less than lithography machine.Under the influence of the current severe international situation and the sanction of the United States government on domestic semiconductor technology,it is particularly important to develop a kind of domestic electronic circuit simulation software with multi-field modeling and simulation ability.The work done in this paper is to design and implement a core function of electronic circuit simulation software-Verilog-A to C language compiler.Specifically,this paper designs and implements a Verilog-A compiler based on SPICE circuit simulation platform to convert Verilog-A source code into C language code for further simulation experiments on SPICE platform.In this paper,the compiler implementation of Verilog-A language to C language is introduced in detail from lexical analysis module,syntax analysis module,semantic analysis module,intermediate code generation module and object code generation module.Then,a series of optimization for SPICE simulation platform is carried out.Finally,two specific component models are used to demonstrate how the compiler converts Verilog-A language description into C language description,and the generated C language description is simulated on SPICE simulation platform,and the circuit waveform output of SPICE simulation platform is analyzed and compared with the results of other advanced simulation software.It proves its feasibility and effectiveness.The implementation of Verilog-A compiler based on SPICE can greatly improve the efficiency of device modeling on SPICE platform,so as to promote the fast verification of the design process.In addition,the implementation method proposed in this paper can also be quickly applied to other similar language compiler implementation,such as Verilog-AMS,VHDL,etc.,so as to achieve a wider range of device model writing and testing. |