Summary of the invention
Fundamental purpose of the present invention is the emulation verification method and the device that provide a kind of SOC, at least to solve the problem.
According to an aspect of the present invention, provide a kind of emulation verification method of SOC (system on a chip), comprise: in simulation process, equipment under test (DUT) utilizes in software module the graphical function preset to generate the graphical controllable interface needed by Direct Programming interface (DPI); By described graphical controllable interface, receive input information and/or the Output simulation information of external unit.
Preferably, described graphical controllable interface comprises: one or more form.
Preferably, when described graphical controllable interface comprises multiple form, the graphical controllable interface that described DUT utilizes in software module the graphical function preset to generate needs by DPI comprises: described DUT imports described graphical function by described DPI, wherein, described graphical function is for setting up the form identical with described multiple form quantity; Described DUT calls described graphical function, sets up described multiple form.
Preferably, described method can also comprise: described software module creates multiple process, each process corresponds to a form in described multiple form, and after setting up described multiple form, form described in each waits for that each event loop that event triggers circulates in each self-corresponding process.
Preferably, when described graphical controllable interface comprises multiple form, the graphical controllable interface that described DUT utilizes in software module the graphical function preset to generate needs by DPI comprises: described DUT imports described graphical function by described DPI, wherein, described graphical function is used for setting up haplopia window; Described DUT calls n described graphical function, sets up described multiple form respectively, and wherein, n is the quantity of described multiple form.
Preferably, after setting up described multiple form, described method can also comprise: described DUT imports multiple handling function by described DPI from described software module, and wherein, each handling function is used for performing a kind of operation to described form; Described DUT calls described handling function, performs corresponding operation to described form; The operation of execution is generated task to described DUT or function exports to described software module.
Preferably, described multiple form can comprise: for show type information form, for showing the form of the image information in emulation and the form for the input information that receives external unit.
Preferably, the input information of described external unit can comprise: DUT parameter; After the input information receiving described external unit, described method can also comprise: the described DUT parameter received exports in described software module by described DPI by described DUT, and described software module utilizes described DUT parameter to be configured renewal to described DUT.
According to a further aspect in the invention, provide a kind of simulating, verifying device of SOC (system on a chip), comprise: equipment under test, for utilizing the graphical function preset in software module to generate the graphical controllable interface needed by DPI in simulation process, by described graphical controllable interface, receive input information and/or the Output simulation information of external unit; Described software module, for providing described graphical function by described DPI.
Preferably, described equipment under test adopts Verilog to describe.
Pass through the present invention, equipment under test is by Direct Programming interface (Direct Programming Interface, referred to as DPI) utilize the graphical function in software module to generate graphical controllable interface, thus outside control can be received in simulation process, solve in correlation technique and cause due to the IO interface do not arranged for external control the problem that the controllability of simulating, verifying is lower, and then improve the controllability of SOC checking.
Embodiment
Hereinafter also describe the present invention in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Fig. 1 is the structural representation of the simulating, verifying device of SOC according to the embodiment of the present invention, as shown in Figure 1, this device mainly comprises: equipment under test (DUT) 10, for utilizing the graphical function preset in software module 20 to generate the graphical controllable interface needed by DPI in simulation process, by described graphical controllable interface, receive input information and/or the Output simulation information of external unit; Software module 20, is communicated with equipment under test 10 by DPI, for providing described graphical function by described DPI.
By the said apparatus of the embodiment of the present invention, equipment under test 10 can utilize the graphical function in software module 20 to generate graphical controllable interface by DPI in simulation process, thus outside can be controlled simulation process by graphical function, and then improve the controllability of checking.
In a preferred implementation of the embodiment of the present invention, equipment under test 10 can be described by Verilog, such as, equipment under test 10 can for describe hardware register transmitting stage (Register Transfer Level, referred to as RTL) module with Verilog.
In another preferred implementation of the embodiment of the present invention, as shown in Figure 2, software module 20 can be that C language realizes, and provides described graphical function.
In a preferred implementation of the embodiment of the present invention, the graphical function that C language realizes can call Xlib storehouse, and the basic function utilizing Xlib storehouse to provide writes the utility function based on X Server.The utility function write is carried out a series ofly to encapsulate flexibly, become and such as create window, create cie system of color representation cie, create the basic handling function such as font and the input of wait event for flexible Application.Wherein, X Window system is the graphic operation interface of UNIX world Plays, what take is the mode operating of Server/Client, Server refers to X Server, be a complete graphic tabletop device, Client refers to all X Window application programs performed in this Display, screen drawing, receives mouse and input through keyboard etc., all must send request to X Server, by X Server on behalf of completing.The line of communication of Server/Client is X Window bottom function storehouse: Xlib.Xlib storehouse provides the access to X server bottom to program, is the storehouse that C language provides simultaneously, and the function that therefore can call Xlib storehouse in C software uses.
As shown in Figure 2, function recycling DPI interface packaged in C imports in the hardware verification environment (comprising DUT 10) of Verilog realization, in Verilog, directly can utilize the graphical function of the support X Server be encapsulated in C like this, set up general Modular jig.By module flexibly exampleization in the verification platform of software and hardware cooperating simulation, the graphical controllable interface expected just can be realized in the process of emulation, the information such as real-time Output simulation image, change DUT configuration parameter etc. at any time, the controllability of whole simulation process and intuitive are greatly enhanced.Module can carry out creating and safeguarding according to concrete needs flexibly simultaneously, and order uses more convenient, and simulation process has more maintainability.
According to the embodiment of the present invention, additionally provide the emulation verification method of a kind of SOC, the method can be realized by the device shown in Fig. 1 or Fig. 2.
Fig. 3 is the process flow diagram of the emulation verification method of SOC according to the embodiment of the present invention, and as shown in Figure 3, the method mainly comprises the following steps:
Step S302, in simulation process, DUT utilizes in software module the graphical function preset to generate the graphical controllable interface needed by DPI;
Wherein, graphical controllable interface can comprise one or more form, and each form may be used for responding different inputs, and wherein, set up haplopia window relatively simple, setting up multiple form in actual applications can be convenient and more directly perceived.Such as, three forms can be set up: a form is for showing type information, a form for showing the image information in emulation, and another form is for receiving the input information (comprising DUT parameter and drawing etc.) of the external unit such as keyboard or mouse.
In specific implementation process, for the foundation of graphical controllable interface comprising multiple form, include but not limited to following two schemes:
The first scheme: write one for creating the module (i.e. graphical function) of multiple form in software module, by DPI, this module is imported in DUT, DUT calls this module, platform module exampleization being entered emulation directly creates multiple form, and each form respectively circular wait event separately triggers;
First scheme: the module (i.e. graphical function) of writing a general haplopia window in software module, by DPI, this module is imported in DUT, then as required, DUT calls this module for many times, the multiple such module of exampleization in platform, create different viewing windows, each form single cycle waits for that the event of oneself triggers.
The first scheme is convenient in actual use, and first scheme is more flexible, can select the mode of employing according to different demands.
Step S304, by described graphical controllable interface, receives input information and/or the Output simulation information of external unit.
Wherein, the input information of external unit comprises: DUT parameter, after the input information receiving described external unit, the described DUT parameter received exports in described software module by described DPI by described DUT, described software module utilizes described DUT parameter to be configured renewal to described DUT, thus follow-up the Realization of Simulation is operated on new DUT configuration, and without the need to reruning emulation, and then improve the efficiency of whole proof procedure.
Below for the device shown in Fig. 2, the flow process setting up many forms in the preferred embodiment of the present invention is described.
Example 1
In this example, above-mentioned first scheme is adopted to create the mode of multiple form, as shown in Figure 4, in this example, first need to link with Xlib storehouse, compile the software based on Xlib, such as, XOpenDisplay () function can be used to obtain display pointer that one is connected to this server, can be packaged into contiguous function, and obtain a rreturn value.The function creation that Xlib namely can be utilized after being connected to X server to provide and initialization window, can set the attribute of window according to the concrete function of window after creating window.Such as, load font, color, then arrange prospect background look, window title etc., these all can be write flexibly according to the function provided in Xlib handbook and encapsulate and then use at window.Next step is the pre-receiving kind of setting window, and such as, window is the response etc. of certain operation receiving keyboard or mouse.After a form sets, whole program just waits in its event loop event_loop that corresponding event triggers, if event obtains triggering and just goes to process this event according to design, judge whether after process still to need to continue wait event, need, return event_loop and continue circular wait, do not need, exit and terminate, wherein, event_loop can write as required.
In a preferred implementation of the embodiment of the present invention, each step can be packaged into function separately by the process of above-mentioned establishment form, calls successively respectively in import to verilog hardware.In another preferred embodiment, overall package can become create the function of viewer module, then imported in hardware environment by DPI and use, all can realize required window-functions.
In embodiments of the present invention, after setting up the desktop window of a general single window module, can exampleization be several in software and hardware cooperating simulation platform flexibly according to specific needs, thus creating multiple viewer module, each module is independently operated in its event loop, can respond respective event respectively and trigger.
Example 2
For the mode adopting the first scheme to create multiple form, if adopt one process to create the mode of many viewer module, the refreshing efficiency that form is drawn can be lower, there is certain delay the time, thus the triggering of some events may be caused not processed in real time, the effect of refreshing is good not.
Such as, if adopt one process to create three viewer module, event_loop circulation is all there is in three c_task, three circulations all will utilize DPI interface to refresh in real time, there will be a circulation and rob the situation that account for event that DPI interface causes other to circulate and also need to wait for the response of DPI interface when triggering, such refreshing efficiency comparison is low, if if other the circulation current state being in derivation (expose) when circulation takies DPI interface, then its event triggers and will can not get response, the process of some events will be lost, and the effect refreshed is bad.
Adopt in this example and create multi-process programming solution in software module, realize three forms and wait for that three event_loop that event triggers circulate in respective process, three processes are independent of each other, no longer seize same DPI interface, the situation of the event of losing can be avoided, and improve the effect of refreshing.
In the preferred implementation of the embodiment of the present invention, setting up when multiple form responds different inputs and various output all to adopt the mode of this multi-process to realize, can in RTL hardware environment many viewer module of the software simulating that exampleization one importing (import) is come in, in emulation when receiving the DUT parameter of input through keyboard, renewal is configured to DUT, follow-up the Realization of Simulation is made to operate on new DUT configuration, and without the need to reruning emulation, improve the efficiency of whole proof procedure.
In above-mentioned example 1 and example 2, after simulating, verifying terminates and terminates all calling, need to close the connection with X Server server, such as, XCloseDisplay (display) function of Xlib can be called.The desktop window module of such foundation is carried out exampleization according to the needs of concrete checking and is used, and the DUT configuration that can realize software-hardware co-designing process is controlled, and increases intuitional means such as exporting printing control information.
From above description, can find out, the embodiment of the present invention provides a kind of utilization to set up the device and method that graphic tabletop viewer module improves proof procedure controllability flexibly, it has can change emulation DUT parameter at any time in the process of software-hardware co-designing, real-time Output simulation information, Output simulation image, the effects such as change block configuration, change uncontrollable defect in simulating, verifying process.Realizing graphic tabletop device within hardware, this module is added software and hardware cooperating simulation verification platform flexibly as a fixture, for verifying the graphic tabletop form providing controlled flexibly, controllability and the intuitive of checking can be increased.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, and in some cases, step shown or described by can performing with the order be different from herein, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.