技术领域Technical Field
本申请涉及仿真技术领域,具体而言,涉及一种基于电路系统级模型的建模仿真方法、装置、介质及设备。The present application relates to the field of simulation technology, and in particular to a modeling and simulation method, device, medium and equipment based on a circuit system-level model.
背景技术Background Art
模拟集成电路建模与仿真是模拟电路设计中密不可分又相互约束的两个重要的工作。模拟集成电路建模的目的是支持电路仿真,以获取相应的电路性能指标。在传统的模拟集成电路设计的建模仿真中,仿真通常是离线进行的,即在电路系统级模型构建完成后,将其输入到仿真工具中,进行仿真计算并提取所需的仿真数据,没有直接将仿真与电路系统级模型结合在一起,难以根据仿真数据对电路系统级模型进行更新和创建,仿真数据的获取效率低,模型的建模效率低。Analog integrated circuit modeling and simulation are two important tasks that are inseparable and mutually constrained in analog circuit design. The purpose of analog integrated circuit modeling is to support circuit simulation to obtain corresponding circuit performance indicators. In the modeling and simulation of traditional analog integrated circuit design, simulation is usually performed offline, that is, after the circuit system-level model is built, it is input into the simulation tool to perform simulation calculations and extract the required simulation data. The simulation is not directly combined with the circuit system-level model, and it is difficult to update and create the circuit system-level model based on the simulation data. The efficiency of obtaining simulation data is low, and the modeling efficiency is low.
因此,如何将仿真与电路系统级模型结合在一起获取仿真数据,提高仿真数据的获取效率和电路的建模仿真效率成为业界亟待解决的技术问题。Therefore, how to combine simulation with circuit system-level models to obtain simulation data and improve the efficiency of simulation data acquisition and circuit modeling and simulation has become a technical problem that needs to be urgently solved in the industry.
发明内容Summary of the invention
本申请提供一种基于电路系统级模型的建模仿真方法、装置、介质及设备,用以解决现有技术中如何将仿真与电路系统级模型结合在一起获取仿真数据,提高仿真数据的获取效率和电路的建模仿真效率的技术问题。The present application provides a modeling and simulation method, device, medium and equipment based on a circuit system-level model, which is used to solve the technical problem in the prior art of how to combine simulation with a circuit system-level model to obtain simulation data, thereby improving the efficiency of obtaining simulation data and the efficiency of circuit modeling and simulation.
第一方面,本申请提供了一种基于电路系统级模型的建模仿真方法,包括:In a first aspect, the present application provides a modeling and simulation method based on a circuit system level model, comprising:
接收用户的仿真数据获取需求;Receive users' simulation data acquisition requirements;
基于电路系统级模型的建模语言和所述仿真数据获取需求,确定所述仿真数据获取需求对应的第一语言;Based on the modeling language of the circuit system level model and the simulation data acquisition requirement, determining a first language corresponding to the simulation data acquisition requirement;
将所述第一语言转换成符合预设执行规则的第二语言;Converting the first language into a second language that complies with a preset execution rule;
执行所述第二语言,得到所述仿真数据获取需求对应的仿真数据和所述仿真数据的获取信息;executing the second language to obtain simulation data corresponding to the simulation data acquisition requirement and acquisition information of the simulation data;
基于所述获取信息对所述电路系统级模型中的仿真工具进行配置,以对电路进行建模。A simulation tool in the circuit system level model is configured based on the acquired information to model the circuit.
在一些实施例中,所述基于电路系统级模型的建模语言和所述仿真数据获取需求,确定所述仿真数据获取需求对应的第一语言,包括:In some embodiments, the determining the first language corresponding to the simulation data acquisition requirement based on the modeling language of the circuit system level model and the simulation data acquisition requirement includes:
基于所述仿真数据获取需求和所述建模语言生成所述仿真数据获取需求对应的数据获取指令流;Generate a data acquisition instruction stream corresponding to the simulation data acquisition requirement based on the simulation data acquisition requirement and the modeling language;
基于所述数据获取指令流中的各个待获取仿真数据,以及各个待仿真数据之间的获取关系生成所述数据获取指令流对应的抽象语法树;Generate an abstract syntax tree corresponding to the data acquisition instruction stream based on each to-be-acquired simulation data in the data acquisition instruction stream and an acquisition relationship between each to-be-simulated data;
基于所述抽象语法树中的各个节点构建计算流图,将所述计算流图作为所述第一语言。A computation flow graph is constructed based on each node in the abstract syntax tree, and the computation flow graph is used as the first language.
在一些实施例中,所述基于所述抽象语法树中的各个节点构建计算流图之后,还包括:In some embodiments, after constructing a computational flow graph based on each node in the abstract syntax tree, the method further includes:
获取所述计算流图中的通路数量和通路特征;Obtaining the number and characteristics of paths in the computational flow graph;
基于所述通路数量和所述通路特征对所述计算流图中的各个操作流程进行排序。The operation flows in the computational flow graph are sorted based on the number of paths and the path characteristics.
在一些实施例中,所述将所述第一语言转换成符合预设执行规则的第二语言,包括:In some embodiments, converting the first language into a second language that complies with a preset execution rule includes:
将符合所述预设执行规则的第一语言确定为通用语言,生成所述通用语言对应的第一执行指令,并将所述第一执行指令与所述通用语言进行绑定;Determine a first language that complies with the preset execution rule as a universal language, generate a first execution instruction corresponding to the universal language, and bind the first execution instruction to the universal language;
将不符合所述预设执行规则的第一语言确定为非通用语言,将所述非通用语言转换成符合所述预设执行规则的第二语言,生成所述第二语言对应的第二执行指令,并将所述第二执行指令与所述第二语言进行绑定。A first language that does not conform to the preset execution rule is determined as a non-universal language, the non-universal language is converted into a second language that conforms to the preset execution rule, a second execution instruction corresponding to the second language is generated, and the second execution instruction is bound to the second language.
在一些实施例中,所述将所述非通用语言转换成符合所述预设执行规则的第二语言,包括:In some embodiments, converting the non-universal language into a second language that complies with the preset execution rule includes:
基于所述非通用语言与各个待获取仿真数据之间的关联关系、所述非通用语言对应的仿真数据获取需求和所述预设执行规则确定所述非通用语言的转换规则;Determining a conversion rule for the non-universal language based on an association relationship between the non-universal language and each simulation data to be acquired, a simulation data acquisition requirement corresponding to the non-universal language, and the preset execution rule;
基于所述转换规则对所述非通用语言进行语言转换,得到符合所述预设执行规则的第二语言。The non-universal language is converted based on the conversion rule to obtain a second language that conforms to the preset execution rule.
在一些实施例中,所述基于所述转换规则对所述非通用语言进行语言转换,得到符合所述预设执行规则的第二语言,包括:In some embodiments, performing language conversion on the non-universal language based on the conversion rule to obtain a second language that complies with the preset execution rule includes:
基于所述转换规则对所述非通用语言进行语言转换,得到初始第二语言;Performing language conversion on the non-universal language based on the conversion rule to obtain an initial second language;
调用仿真程序对所述初始第二语言进行验证,得到初始仿真数据;Calling a simulation program to verify the initial second language to obtain initial simulation data;
在所述初始仿真数据符合预期数据范围的情况下,将所述初始第二语言作为所述第二语言。When the initial simulation data meets the expected data range, the initial second language is used as the second language.
在一些实施例中,所述基于所述获取信息对所述电路系统级模型中的仿真工具进行配置,包括:In some embodiments, configuring a simulation tool in the circuit system level model based on the acquired information includes:
提取所述仿真数据获取过程中的获取信息,所述获取信息包括所述仿真工具使用的接口信息和过程数据的调用路径;Extracting acquisition information in the simulation data acquisition process, wherein the acquisition information includes interface information used by the simulation tool and a calling path of process data;
基于所述获取信息定义所述仿真工具的配置参数,以对所述仿真工具进行配置。Configuration parameters of the simulation tool are defined based on the acquired information to configure the simulation tool.
第二方面,本申请提供了一种基于电路系统级模型的建模仿真装置,包括:In a second aspect, the present application provides a modeling and simulation device based on a circuit system level model, comprising:
接收模块,用于接收用户的仿真数据获取需求;A receiving module, used for receiving a user's simulation data acquisition requirement;
确定模块,用于基于电路系统级模型的建模语言和所述仿真数据获取需求,确定所述仿真数据获取需求对应的第一语言;A determination module, configured to determine a first language corresponding to the simulation data acquisition requirement based on a modeling language of a circuit system-level model and the simulation data acquisition requirement;
转换模块,用于将所述第一语言转换成符合预设执行规则的第二语言;A conversion module, used for converting the first language into a second language that complies with a preset execution rule;
执行模块,用于执行所述第二语言,得到所述仿真数据获取需求对应的仿真数据和所述仿真数据的获取信息;An execution module, used for executing the second language to obtain simulation data corresponding to the simulation data acquisition requirement and acquisition information of the simulation data;
配置模块,用于基于所述获取信息对所述电路系统级模型中的仿真工具进行配置,以对电路进行建模。A configuration module is used to configure a simulation tool in the circuit system level model based on the acquired information to model the circuit.
第三方面,本申请提供了一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述的方法。In a third aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the above method when executed by a processor.
第四方面,本申请提供了一种电子设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行所述程序时实现上述的方法。In a fourth aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to implement the above method when executing the program through the computer program.
本申请提供的基于电路系统级模型的建模仿真方法、装置、介质及设备,通过建模语言和用户的仿真数据获取需求确定第一语言,将第一语言转换成第二语言,从而得到仿真数据,提高了仿真数据的获取效率;通过在电路系统级模型中设置仿真工具,根据仿真数据的获取信息对仿真工具进行配置,对电路进行建模,实现了电路系统级模型与仿真的有效结合,提高了电路建模仿真效率。The modeling and simulation method, apparatus, medium and equipment based on the circuit system level model provided in the present application determine the first language through the modeling language and the simulation data acquisition requirements of the user, convert the first language into a second language, thereby obtaining simulation data, thereby improving the efficiency of obtaining simulation data; by setting a simulation tool in the circuit system level model, configuring the simulation tool according to the acquisition information of the simulation data, and modeling the circuit, an effective combination of the circuit system level model and simulation is achieved, thereby improving the efficiency of circuit modeling and simulation.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
为了更清楚地说明本申请或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1为本申请实施例提供的基于电路系统级模型的建模仿真方法的流程示意图之一;FIG1 is a flow chart of a modeling and simulation method based on a circuit system level model provided in an embodiment of the present application;
图2为本申请实施例提供的基于电路系统级模型的建模仿真方法的流程示意图之二;FIG2 is a second flow chart of a modeling and simulation method based on a circuit system level model provided in an embodiment of the present application;
图3为本申请实施例提供的基于电路系统级模型的建模仿真装置的结构示意图之一;FIG3 is a schematic diagram of a structure of a modeling and simulation device based on a circuit system level model provided in an embodiment of the present application;
图4为本申请实施例提供的基于电路系统级模型的建模仿真装置的结构示意图之二;FIG4 is a second structural schematic diagram of a modeling and simulation device based on a circuit system level model provided in an embodiment of the present application;
图5为本申请实施例提供的电子设备的结构示意图。FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
需要说明的是,本申请中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。It should be noted that the terms "first", "second" etc. in the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or modules need not be limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or equipment.
本申请实施例提供的基于电路系统级模型的建模仿真方法适用于终端,终端可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于服务器、智能手机、平板电脑、膝上型便携计算机和台式计算机等。The modeling and simulation method based on the circuit system level model provided in the embodiment of the present application is applicable to a terminal, which may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to servers, smart phones, tablet computers, laptop computers, and desktop computers.
图1为本申请实施例提供的基于电路系统级模型的建模仿真方法的流程示意图之一,如图1所示,该方法包括步骤110、步骤120、步骤130、步骤140和步骤150。该方法流程步骤仅仅作为本申请一个可能的实现方式。FIG1 is one of the flow diagrams of the modeling and simulation method based on the circuit system level model provided in the embodiment of the present application. As shown in FIG1 , the method includes step 110, step 120, step 130, step 140 and step 150. The steps of the method flow are only a possible implementation of the present application.
步骤110、接收用户的仿真数据获取需求。Step 110: Receive a user's simulation data acquisition requirement.
具体地,本申请实施例提供的基于电路系统级模型的建模仿真方法的执行主体为基于电路系统级模型的建模仿真装置,该装置可以为终端中独立设置的硬件设备,也可以为运行在终端中的软件程序。例如,当终端为手机时,基于电路系统级模型的建模仿真装置可以体现为手机中的建模仿真软件等应用程序。Specifically, the execution subject of the modeling and simulation method based on the circuit system level model provided in the embodiment of the present application is a modeling and simulation device based on the circuit system level model, which can be a hardware device independently set in the terminal, or a software program running in the terminal. For example, when the terminal is a mobile phone, the modeling and simulation device based on the circuit system level model can be embodied as an application such as modeling and simulation software in the mobile phone.
仿真数据获取需求是指用户针对当前场景下,根据需求确定的需要获取的仿真数据类型、范围、格式、精度和时间等方面的要求。仿真数据获取需求能够指导基于电路系统级模型的建模仿真装置完成仿真数据的获取工作。Simulation data acquisition requirements refer to the requirements of the user for the type, scope, format, accuracy and time of simulation data to be acquired in the current scenario. The simulation data acquisition requirements can guide the modeling and simulation device based on the circuit system level model to complete the acquisition of simulation data.
仿真数据获取需求是用户提供的。仿真数据获取需求中可以包括待获取的仿真数据和各个仿真数据之间的关联关系等。The simulation data acquisition requirement is provided by the user and may include the simulation data to be acquired and the association relationship between each simulation data.
步骤120、基于电路系统级模型的建模语言和仿真数据获取需求,确定仿真数据获取需求对应的第一语言。Step 120 : Determine a first language corresponding to the simulation data acquisition requirement based on the modeling language of the circuit system level model and the simulation data acquisition requirement.
具体地,电路系统级模型是一种用于描述和仿真电路系统的模型。它可以提供对电路系统整体行为和性能的准确建模,并支持对电路中的各个组件进行交互和动态分析。电路系统级模型可以通过使用方程、参数化的模型和子模块等方式来描述系统的输入、输出和内部运行机制。Specifically, a circuit system level model is a model used to describe and simulate a circuit system. It can provide accurate modeling of the overall behavior and performance of the circuit system, and support interactive and dynamic analysis of the various components in the circuit. The circuit system level model can describe the input, output, and internal operating mechanism of the system by using equations, parameterized models, and submodules.
本申请实施例的电路系统级模型中包括仿真工具,因此具备仿真功能,可以根据用户的仿真数据获取需求构建仿真环境,即构建具体执行仿真的流程,从而得到仿真数据获取需求对应的仿真数据。The circuit system-level model of the embodiment of the present application includes a simulation tool and therefore has a simulation function. A simulation environment can be constructed according to the user's simulation data acquisition requirements, that is, a specific simulation execution process can be constructed to obtain simulation data corresponding to the simulation data acquisition requirements.
电路系统级模型的建模语言是系统级建模语言,是用来描述仿真系统或过程的语言。本申请实施例的电路系统级模型的建模语言具有内置的能力,可以方便地嵌入对仿真数据和仿真指令的描述、定义和处理。The modeling language of the circuit system level model is a system level modeling language, which is used to describe a simulation system or process. The modeling language of the circuit system level model of the embodiment of the present application has built-in capabilities, which can easily embed descriptions, definitions and processing of simulation data and simulation instructions.
第一语言是通过仿真数据获取需求和电路系统级模型的建模语言构建的一种中间文件。第一语言可以是流程图这种数据结构的文件。The first language is an intermediate file constructed by the modeling language of the simulation data acquisition requirements and the circuit system level model. The first language can be a file of a data structure such as a flowchart.
因为仿真数据获取需求是一些需求信息,建模仿真装置难以识别具体的需求,因此需要根据仿真数据获取需求和电路系统级模型的建模语言确定第一语言,从而使建模仿真装置更准确地识别出用户对仿真数据获取的需求。Because the simulation data acquisition requirements are some demand information, it is difficult for the modeling and simulation device to identify the specific requirements. Therefore, it is necessary to determine the first language based on the simulation data acquisition requirements and the modeling language of the circuit system-level model, so that the modeling and simulation device can more accurately identify the user's needs for simulation data acquisition.
步骤130、将第一语言转换成符合预设执行规则的第二语言。Step 130: Convert the first language into a second language that complies with a preset execution rule.
具体地,预设执行规则是指在仿真数据获取过程中,预先定义好的一些规则和流程,用于判断当前的语言是否能够直接生成相应的指令去执行。Specifically, the preset execution rules refer to some pre-defined rules and processes in the process of obtaining simulation data, which are used to determine whether the current language can directly generate corresponding instructions for execution.
第二语言是符合预设执行规则,可以直接绑定执行指令进行执行的文件。The second language is a file that complies with preset execution rules and can be directly bound to execution instructions for execution.
第一语言中包括多个操作流程,这些操作流程中可能存在不符合预设执行规则的流程,因此需要将该部分流程进行语言转换,得到符合预设执行规则的第二语言。The first language includes multiple operation processes, and some of these operation processes may not comply with preset execution rules. Therefore, it is necessary to convert the language of these processes to obtain a second language that complies with the preset execution rules.
例如,第一语言中的流程描述只是简单的两个判断逻辑,但这两个判断逻辑难以直接执行,还需要拆成多个流程步骤,才能完成最终的判断,因此需要将这两个判断逻辑进行语言转换,转换成多个可以直接执行的步骤,该多个可以直接执行的步骤就是该部分第一语言对应的第二语言。For example, the process description in the first language is just two simple judgment logics, but these two judgment logics are difficult to execute directly and need to be broken down into multiple process steps to complete the final judgment. Therefore, it is necessary to convert these two judgment logics into multiple steps that can be executed directly. The multiple steps that can be executed directly are the second language corresponding to this part of the first language.
第一语言和第二语言都可以是一种中间文件,其他系统可以调用第一语言和第二语言,对其进行处理并应用于其他场景中。Both the first language and the second language can be an intermediate file. Other systems can call the first language and the second language, process them, and apply them to other scenarios.
步骤140、执行第二语言,得到仿真数据获取需求对应的仿真数据和仿真数据的获取信息。Step 140: execute the second language to obtain simulation data and simulation data acquisition information corresponding to the simulation data acquisition requirement.
具体地,得到第二语言后,可以执行第二语言的执行指令,从而得到仿真数据获取需求对应的仿真数据。Specifically, after obtaining the second language, the execution instructions of the second language may be executed, thereby obtaining simulation data corresponding to the simulation data acquisition requirement.
获取信息为当前的电路系统级模型使用仿真工具执行第二语言的执行指令的具体执行步骤,包括使用的接口信息、过程数据的调用路径和调用的数据等。The information obtained is the specific execution steps of the execution instructions of the second language using the simulation tool for the current circuit system level model, including the interface information used, the calling path of the process data and the called data, etc.
可以在执行指令的执行过程中实时获取仿真数据的获取信息,也可以在执行结束后获取仿真数据的获取信息。The acquisition information of the simulation data may be acquired in real time during the execution of the instruction, or may be acquired after the execution is completed.
步骤150、基于获取信息对电路系统级模型中的仿真工具进行配置,以对电路进行建模。Step 150: Configure a simulation tool in the circuit system level model based on the acquired information to model the circuit.
具体地,可以根据获取信息对仿真工具进行配置,从而对电路进行建模。Specifically, a simulation tool may be configured according to the acquired information to model the circuit.
可以使用领域特定语言(Domain-Specific Language,DSL)作为仿真工具的配置语言。根据获取信息对仿真工具进行DSL定义,对电路进行建模。A domain-specific language (DSL) may be used as a configuration language for the simulation tool. The simulation tool is defined by the DSL according to the acquired information to model the circuit.
建模后的电路系统级模型中包括了当前仿真数据获取需求对应的配置好的仿真工具,因此在再次接收仿真数据获取需求时,可以直接通过仿真工具得到仿真数据,不需要再次对仿真数据获取需求进行处理。The modeled circuit system-level model includes the configured simulation tools corresponding to the current simulation data acquisition requirements. Therefore, when the simulation data acquisition requirements are received again, the simulation data can be directly obtained through the simulation tools without the need to process the simulation data acquisition requirements again.
本申请实施例提供的基于电路系统级模型的建模仿真方法,通过系统级建模语言和用户的仿真数据获取需求确定第一语言,将第一语言转换成第二语言,从而得到仿真数据,提高了仿真数据的获取效率;通过在电路系统级模型中设置仿真工具,根据仿真数据的获取信息对仿真工具进行配置,对电路进行建模,实现了电路系统级模型与仿真的有效结合,提高了电路的建模仿真效率。The modeling and simulation method based on the circuit system-level model provided in the embodiment of the present application determines a first language through a system-level modeling language and a user's simulation data acquisition requirements, converts the first language into a second language, thereby obtaining simulation data, thereby improving the efficiency of obtaining simulation data; by setting a simulation tool in the circuit system-level model, configuring the simulation tool according to the acquisition information of the simulation data, and modeling the circuit, an effective combination of the circuit system-level model and simulation is achieved, thereby improving the modeling and simulation efficiency of the circuit.
需要说明的是,本申请每一个实施方式可以自由组合、调换顺序或者单独执行,并不需要依靠或依赖固定的执行顺序。It should be noted that each implementation method of the present application can be freely combined, the order can be changed, or it can be executed separately, and does not need to rely on or depend on a fixed execution order.
在一些实施例中,步骤120包括:In some embodiments, step 120 includes:
基于仿真数据获取需求和建模语言生成仿真数据获取需求对应的数据获取指令流;Generate a data acquisition instruction stream corresponding to the simulation data acquisition requirement based on the simulation data acquisition requirement and the modeling language;
基于数据获取指令流中的各个待获取仿真数据,以及各个待仿真数据之间的获取关系生成数据获取指令流对应的抽象语法树;Generate an abstract syntax tree corresponding to the data acquisition instruction stream based on each to-be-acquired simulation data in the data acquisition instruction stream and an acquisition relationship between each to-be-simulated data;
基于抽象语法树中的各个节点构建计算流图,将计算流图作为第一语言。A computational flow graph is constructed based on each node in the abstract syntax tree, and the computational flow graph is used as the first language.
基于抽象语法树中的各个节点构建计算流图之后,还包括:After building the computational flow graph based on each node in the abstract syntax tree, it also includes:
获取计算流图中的通路数量和通路特征;Obtain the number and characteristics of paths in the computational flow graph;
基于通路数量和通路特征对计算流图中的各个操作流程进行排序。The operation processes in the computational flow graph are sorted based on the number of paths and path characteristics.
具体地,数据获取指令流为根据仿真数据获取需求和建模语言生成的数据获取指令集合,集合中包括至少一个数据获取指令。因为数据获取指令流是用户提供的,也可以称为用户层指令流。Specifically, the data acquisition instruction stream is a data acquisition instruction set generated according to the simulation data acquisition requirements and the modeling language, and the set includes at least one data acquisition instruction. Because the data acquisition instruction stream is provided by the user, it can also be called a user layer instruction stream.
数据获取指令流中包括各个待获取仿真数据各个待仿真数据之间的获取关系和各个执行步骤之间的依赖关系等。The data acquisition instruction stream includes various simulation data to be acquired, acquisition relationships between various simulation data to be simulated, and dependency relationships between various execution steps.
待获取仿真数据为根据仿真数据获取需求确定的需要获取的仿真数据。The simulation data to be acquired is the simulation data that needs to be acquired according to the simulation data acquisition requirement.
可以对数据获取指令流进行解析,根据解析结果生成该数据获取指令流对应的抽象语法树(Abstract Syntax Tree,AST)。AST上的各个节点可以是各个执行步骤,也可以是各个待获取仿真数据。The data acquisition instruction stream can be parsed, and an abstract syntax tree (AST) corresponding to the data acquisition instruction stream can be generated according to the parsing result. Each node on the AST can be each execution step or each simulation data to be acquired.
计算流图为包括具体执行流程的文件。The computation flow graph is a file that includes a specific execution process.
可以根据AST的各个节点,以及各个节点之间的关联关系构建计算流图,并将计算流图作为第一语言。A computational flow graph can be constructed based on each node of the AST and the relationship between each node, and the computational flow graph can be used as the first language.
可以对计算流图中的各个节点进行全局排序。计算流图中的各个节点可以是具体的操作步骤。Each node in the computation flow graph can be globally sorted. Each node in the computation flow graph can be a specific operation step.
可以将操作步骤转变为逻辑运算算子完成逻辑关系的判断,从而获取计算流图中的通路数量和通路特征。例如,当判断结果为真时,代表其逻辑通路成立,即运算通路成立,则表明该操作步骤是通路。通路特征可以包括通路路径、通路节点和通路执行时长等。The operation steps can be transformed into logical operators to complete the judgment of logical relations, thereby obtaining the number of paths and path characteristics in the calculation flow graph. For example, when the judgment result is true, it means that its logical path is established, that is, the operation path is established, which indicates that the operation step is a path. Path characteristics can include path paths, path nodes, and path execution time.
无论AST中有没有嵌套,均可以按行采用全局计数的方式对计算流图中的节点进行排序,可以通过计算流图中的通路数量和通路特征取得计算流图中所有变量和操作步骤的唯一序号,完成全局排序。Regardless of whether there is nesting in the AST, the nodes in the computational flow graph can be sorted by row using a global count method. The unique serial numbers of all variables and operation steps in the computational flow graph can be obtained through the number of paths and path characteristics in the computational flow graph to complete the global sorting.
可以根据计算流图中的各个操作流程的排序结果确定后续的执行步骤,其中部分操作流程也可以根据实际情况设置具体的操作时间。The subsequent execution steps can be determined according to the sorting results of each operation process in the calculation flow graph, and some operation processes can also set specific operation times according to actual conditions.
本申请实施例提供的基于电路系统级模型的建模仿真方法,通过对仿真数据获取需求进行转换可以得到第一语言,得到更加明确的获取仿真数据的操作步骤,实现仿真数据的获取,提高了仿真数据的获取准确度。The modeling and simulation method based on the circuit system level model provided in the embodiment of the present application can obtain the first language by converting the simulation data acquisition requirements, obtain clearer operation steps for obtaining simulation data, realize the acquisition of simulation data, and improve the accuracy of simulation data acquisition.
在一些实施例中,步骤130包括:In some embodiments, step 130 includes:
将符合预设执行规则的第一语言确定为通用语言,生成通用语言对应的第一执行指令,并将第一执行指令与通用语言进行绑定;Determine a first language that complies with a preset execution rule as a universal language, generate a first execution instruction corresponding to the universal language, and bind the first execution instruction to the universal language;
将不符合预设执行规则的第一语言确定为非通用语言,将非通用语言转换成符合预设执行规则的第二语言,生成第二语言对应的第二执行指令,并将第二执行指令与第二语言进行绑定。A first language that does not conform to a preset execution rule is determined as a non-universal language, the non-universal language is converted into a second language that conforms to the preset execution rule, a second execution instruction corresponding to the second language is generated, and the second execution instruction is bound to the second language.
将非通用语言转换成符合预设执行规则的第二语言,包括:Convert a non-common language into a second language that complies with preset execution rules, including:
基于非通用语言与各个待获取仿真数据之间的关联关系、非通用语言对应的仿真数据获取需求和预设执行规则确定非通用语言的转换规则;Determine a conversion rule for the non-universal language based on an association relationship between the non-universal language and each simulation data to be acquired, a simulation data acquisition requirement corresponding to the non-universal language, and a preset execution rule;
基于转换规则对非通用语言进行语言转换,得到符合预设执行规则的第二语言。Based on the conversion rules, the non-universal language is converted into a second language that meets the preset execution rules.
基于转换规则对非通用语言进行语言转换,得到符合预设执行规则的第二语言,包括:Based on the conversion rules, the non-universal language is converted to obtain a second language that meets the preset execution rules, including:
基于转换规则对非通用语言进行语言转换,得到初始第二语言;Perform language conversion on the non-universal language based on conversion rules to obtain an initial second language;
调用仿真程序对初始第二语言进行验证,得到初始仿真数据;Calling a simulation program to verify the initial second language and obtain initial simulation data;
在初始仿真数据符合预期数据范围的情况下,将初始第二语言作为第二语言。In the case where the initial simulation data meets the expected data range, the initial second language is used as the second language.
具体地,因为第一语言是通过对仿真数据获取需求进行格式转化和逻辑转换得到的,因此部分第一语言难以通过建模仿真装置直接执行。Specifically, because the first language is obtained by performing format conversion and logic transformation on the simulation data acquisition requirements, part of the first language is difficult to be directly executed by the modeling simulation device.
因此本申请实施例设置预设执行规则。预设执行规则为针对第一语言的操作流程定义的各种规则的结合,用于判断第一语言中当前的操作流程是否为通用的建模仿真装置可以执行的流程。Therefore, the embodiment of the present application sets a preset execution rule. The preset execution rule is a combination of various rules defined for the operation process of the first language, and is used to determine whether the current operation process in the first language is a process that can be executed by a general modeling and simulation device.
若第一语言中当前的操作流程符合预设执行规则,将该操作流程对应的第一语言部分确定为通用语言,该通用语言就是符合预设执行规则的当前的操作流程。对于通用语言可以直接生成其对应的第一执行指令,并将第一执行指令与该通用语言进行绑定,从而执行当前操作流程。符合预设执行规则的第一语言可以直接作为第二语言,无需转换。If the current operation process in the first language meets the preset execution rules, the first language part corresponding to the operation process is determined as the universal language, and the universal language is the current operation process that meets the preset execution rules. For the universal language, the corresponding first execution instruction can be directly generated, and the first execution instruction is bound to the universal language to execute the current operation process. The first language that meets the preset execution rules can be directly used as the second language without conversion.
若第一语言中当前的操作流程不符合预设执行规则,将该操作流程对应的第一语言部分确定为非通用语言。该非通用语言就是不符合预设执行规则的当前的操作流程。If the current operation flow in the first language does not conform to the preset execution rules, the first language portion corresponding to the operation flow is determined as a non-universal language. The non-universal language is the current operation flow that does not conform to the preset execution rules.
对于非通用语言需要进行语言转换,即改写第一语言得到第二语言。For non-universal languages, language conversion is required, that is, rewriting the first language to obtain the second language.
可以通过AST中对于该操作流程记录的数据和操作流程约束条件,改写模板和当前操作流程与各个带获取仿真数据之间的关联关系、当前操作流程对应的仿真数据获取需求和预设执行规则等确定当前非通用语言对应操作流程的转换规则。根据转换规则对非通用语言进行语言转换,得到初始第二语言。The conversion rules for the current non-universal language corresponding to the operation process can be determined through the data and operation process constraints recorded in the AST for the operation process, the association between the rewriting template and the current operation process and each band to obtain simulation data, the simulation data acquisition requirements and preset execution rules corresponding to the current operation process, etc. The non-universal language is converted into an initial second language according to the conversion rules.
可以使用对初始第二语言进行仿真测试,验证初始第二语言是否符合预设执行规则并可以成功执行。在进行仿真测试时,可以通过仿真器指定调用外部程序或一些应用程序接口(Application Programming Interface,API),执行改写后的第二语言对应的仿真程序,获取初始仿真数据,若在初始仿真数据符合预期数据范围,则将初始第二语言作为第二语言;若不符合则继续执行语言转换步骤直至得到符合预期数据范围和符合预设执行规则的第二语言。The initial second language can be used for simulation testing to verify whether the initial second language meets the preset execution rules and can be successfully executed. When performing simulation testing, the simulator can specify to call external programs or some application programming interfaces (Application Programming Interface, API), execute the simulation program corresponding to the rewritten second language, obtain the initial simulation data, and if the initial simulation data meets the expected data range, the initial second language is used as the second language; if not, continue to execute the language conversion step until a second language that meets the expected data range and meets the preset execution rules is obtained.
得到第二语言后可以生成第二语言对应的第二执行指令,并将第二执行指令与第二语言进行绑定。After obtaining the second language, a second execution instruction corresponding to the second language may be generated, and the second execution instruction may be bound to the second language.
可以根据第二语言的数据结构指定新的输入输出的数据形状。在完成所有改写并按需要完成仿真测试后,所有计算流图需要获取的数据均已就绪。The new input and output data shapes can be specified according to the data structure of the second language. After all rewriting is completed and simulation tests are completed as needed, all the data required by the computational flow graph are ready.
改写后的操作步骤的第二语言的语法规则可以为:The grammatical rules of the second language of the rewritten operation steps can be:
%result\_list<="operation_name"(%input\_list){attribute\_list}∶(input\_type\_list)→(output\_type\_list)%result\_list<="operation_name"(%input\_list){attribute\_list}: (input\_type\_list)→(output\_type\_list)
其中,"operation_name"为操作流程的运算操作符名称;result\_list为"operation_name"的计算结果项;input\_list为"operation_name"的输入项;attribute\_list为"operation_name"的操作流程运算属性列表;input\_type\_list为"operation_name"的输入项的类型和数据形态标志;output\_type\_list为"operation_name"的计算结果项的类型和数据形态标志。Among them, "operation_name" is the name of the operation operator of the operation process; result\_list is the calculation result item of "operation_name"; input\_list is the input item of "operation_name"; attribute\_list is the operation process calculation attribute list of "operation_name"; input\_type\_list is the type and data form mark of the input item of "operation_name"; output\_type\_list is the type and data form mark of the calculation result item of "operation_name".
在本申请的实施例中,语言转换步骤可以反复执行多次,并逐步增添到记录表中,保证最终得到的第二语言都是可以绑定执行指令并进行执行的。In the embodiment of the present application, the language conversion step can be repeatedly executed multiple times and gradually added to the record table to ensure that the second language finally obtained can be bound to the execution instruction and executed.
本申请实施例提供的基于电路系统级模型的建模仿真方法,通过将第一语言转换成第二语言,可以获得可以直接执行的操作流程,提高了仿真数据的获取效率。The modeling and simulation method based on the circuit system level model provided in the embodiment of the present application can obtain an operation flow that can be directly executed by converting a first language into a second language, thereby improving the efficiency of obtaining simulation data.
在一些实施例中,步骤150包括:In some embodiments, step 150 includes:
提取仿真数据获取过程中的获取信息,获取信息包括仿真工具使用的接口信息和过程数据的调用路径;Extracting acquisition information during the simulation data acquisition process, the acquisition information includes interface information used by the simulation tool and the calling path of the process data;
基于获取信息定义仿真工具的配置参数,以对仿真工具进行配置。Configuration parameters of the simulation tool are defined based on the acquired information to configure the simulation tool.
具体地,执行第二语言的执行指令后,可以得到各个待获取数据,从而可以向客户端输出仿真数据获取需求对应的仿真数据。执行指令可以通过通常的目标系统执行,也可以通过外部系统执行。Specifically, after executing the execution instruction of the second language, various data to be acquired can be obtained, so that the simulation data corresponding to the simulation data acquisition requirement can be output to the client. The execution instruction can be executed by a common target system or by an external system.
可以提取执行第二语言执行指令的过程中仿真工具的调用记录,调用记录包括仿真工具使用的接口信息和过程数据的调用路径等。根据调用记录得到获取信息。The call record of the simulation tool in the process of executing the second language execution instruction can be extracted, and the call record includes the interface information used by the simulation tool and the call path of the process data, etc. The acquisition information is obtained according to the call record.
对获取到的获取信息和仿真数据,进行分析和判断,包括对调用记录的解析、通路的判断,以及对根据获取信息定义仿真工具的配置参数,以对仿真工具进行配置、对仿真工具配置记录的更新等。这可以用于维护仿真工具和仿真数据获取需求之间关联关系,以便在后续的执行过程中能够正确调用相应的仿真工具。The acquired acquisition information and simulation data are analyzed and judged, including parsing the call records, judging the paths, defining the configuration parameters of the simulation tool according to the acquired information, configuring the simulation tool, updating the simulation tool configuration records, etc. This can be used to maintain the association between the simulation tool and the simulation data acquisition requirements, so that the corresponding simulation tool can be correctly called in the subsequent execution process.
可以通过编译电路系统级模型和获取信息得到各个仿真工具的DSL定义。向用户输出仿真工具的DSL定义,通过DSL定义可以查看仿真数据的具体获取步骤、仿真工具使用的接口信息和过程数据的调用路径等。还可以通过DSL定义对电路系统级模型中的仿真工具进行配置。The DSL definition of each simulation tool can be obtained by compiling the circuit system level model and obtaining information. The DSL definition of the simulation tool is output to the user. Through the DSL definition, the specific acquisition steps of the simulation data, the interface information used by the simulation tool, and the calling path of the process data can be viewed. The simulation tool in the circuit system level model can also be configured through the DSL definition.
本申请实施例提供的基于电路系统级模型的建模仿真方法,通过对仿真工具进行配置,使得再次接收仿真数据获取需求时,直接根据该仿真数据获取需求对应的仿真工具即可获取仿真数据,提高了仿真数据的获取效率。The modeling and simulation method based on the circuit system level model provided in the embodiment of the present application configures the simulation tool so that when a simulation data acquisition requirement is received again, the simulation data can be directly acquired according to the simulation tool corresponding to the simulation data acquisition requirement, thereby improving the efficiency of simulation data acquisition.
图2为本申请实施例提供的基于电路系统级模型的建模仿真方法的流程示意图之二,如图2所示,该方法包括:FIG. 2 is a second flow chart of a modeling and simulation method based on a circuit system level model provided in an embodiment of the present application. As shown in FIG. 2 , the method includes:
步骤210、根据用户的仿真数据获取需求得到用户层指令流,解析用户层指令流得到用户层指令流对应的AST;Step 210: Obtain a user layer instruction stream according to the user's simulation data acquisition requirements, and parse the user layer instruction stream to obtain an AST corresponding to the user layer instruction stream;
步骤220、分析AST,并根据AST得到第一语言;Step 220, analyzing the AST, and obtaining the first language according to the AST;
步骤230、改写第一语言得到第二语言;Step 230, rewriting the first language to obtain the second language;
步骤240、执行第二语言的执行指令并提取调用记录,向用户输出仿真数据和仿真工具的DSL定义。Step 240: execute the execution instruction of the second language and extract the call record, and output the simulation data and the DSL definition of the simulation tool to the user.
本申请实施例提供的基于电路系统级模型的建模仿真方法,可以根据仿真数据获取需求得到待获取仿真数据和待获取仿真数据之间的关联关系;通过改写第一语言得到第二语言可以得到待获取仿真数据的具体获取流程操作步骤,提高了仿真数据的获取效率,实现电路的建模仿真的结合,提高了电路的建模仿真效率。The modeling and simulation method based on the circuit system-level model provided in the embodiment of the present application can obtain the correlation relationship between the simulation data to be obtained and the simulation data to be obtained according to the simulation data acquisition requirements; by rewriting the first language to obtain the second language, the specific acquisition process operation steps of the simulation data to be obtained can be obtained, thereby improving the efficiency of obtaining simulation data, realizing the combination of circuit modeling and simulation, and improving the efficiency of circuit modeling and simulation.
下面对本申请实施例提供的基于电路系统级模型的建模仿真装置进行描述,下文描述的基于电路系统级模型的建模仿真装置与上文描述的基于电路系统级模型的建模仿真方法可相互对应参照。The modeling and simulation device based on the circuit system level model provided in an embodiment of the present application is described below. The modeling and simulation device based on the circuit system level model described below and the modeling and simulation method based on the circuit system level model described above can be referenced to each other.
图3为本申请实施例提供的基于电路系统级模型的建模仿真装置的结构示意图之一,如图3所示,该装置包括接收模块310、确定模块320、转换模块330、执行模块340和配置模块350。Figure 3 is one of the structural schematic diagrams of the modeling and simulation device based on the circuit system level model provided in an embodiment of the present application. As shown in Figure 3, the device includes a receiving module 310, a determining module 320, a conversion module 330, an execution module 340 and a configuration module 350.
接收模块,用于接收用户的仿真数据获取需求;A receiving module, used for receiving a user's simulation data acquisition requirement;
确定模块,用于基于电路系统级模型的建模语言和仿真数据获取需求,确定仿真数据获取需求对应的第一语言;A determination module, used to determine a first language corresponding to the simulation data acquisition requirement based on a modeling language of a circuit system-level model and a simulation data acquisition requirement;
转换模块,用于将第一语言转换成符合预设执行规则的第二语言;A conversion module, used for converting a first language into a second language that complies with a preset execution rule;
执行模块,用于执行第二语言,得到仿真数据获取需求对应的仿真数据和仿真数据的获取信息;An execution module, used for executing the second language, obtaining simulation data and simulation data acquisition information corresponding to the simulation data acquisition requirement;
配置模块,用于基于获取信息对电路系统级模型中的仿真工具进行配置,以对电路进行建模。The configuration module is used to configure a simulation tool in a circuit system level model based on the acquired information to model the circuit.
具体地,根据本申请的实施例,接收模块、确定模块、转换模块、执行模块和配置模块中的任意多个模块可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。Specifically, according to an embodiment of the present application, any multiple modules among the receiving module, the determining module, the converting module, the executing module and the configuring module may be combined into one module for implementation, or any one of the modules may be split into multiple modules.
或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module.
根据本申请的实施例,接收模块、确定模块、转换模块、执行模块和配置模块中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。According to an embodiment of the present application, at least one of the receiving module, the determining module, the converting module, the executing module and the configuring module may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented by hardware or firmware such as any other reasonable method of integrating or packaging the circuit, or may be implemented in any one of the three implementation methods of software, hardware and firmware, or in an appropriate combination of any of them.
或者,接收模块、确定模块、转换模块、执行模块和配置模块中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。Alternatively, at least one of the receiving module, the determining module, the converting module, the executing module and the configuring module may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be performed.
本申请实施例提供的基于电路系统级模型的建模仿真装置,通过建模语言和用户的仿真数据获取需求确定第一语言,将第一语言转换成第二语言,从而得到仿真数据,提高了仿真数据的获取效率;通过在电路系统级模型中设置仿真工具,根据仿真数据的获取信息对仿真工具进行配置,对电路进行建模,实现了电路系统级模型与仿真的有效结合,提高了电路建模仿真效率。The modeling and simulation device based on the circuit system level model provided in the embodiment of the present application determines the first language through the modeling language and the simulation data acquisition requirements of the user, converts the first language into a second language, thereby obtaining simulation data, thereby improving the efficiency of obtaining simulation data; by setting a simulation tool in the circuit system level model, configuring the simulation tool according to the acquisition information of the simulation data, and modeling the circuit, the effective combination of the circuit system level model and simulation is achieved, thereby improving the efficiency of circuit modeling and simulation.
在一些实施例中,确定模块具体用于:In some embodiments, the determination module is specifically configured to:
基于仿真数据获取需求和系统级建模语言生成仿真数据获取需求对应的数据获取指令流;Generate a data acquisition instruction stream corresponding to the simulation data acquisition requirement based on the simulation data acquisition requirement and the system-level modeling language;
基于数据获取指令流中的各个待获取仿真数据,以及各个待仿真数据之间的获取关系生成数据获取指令流对应的抽象语法树;Generate an abstract syntax tree corresponding to the data acquisition instruction stream based on each to-be-acquired simulation data in the data acquisition instruction stream and an acquisition relationship between each to-be-simulated data;
基于抽象语法树中的各个节点构建计算流图,将计算流图作为第一语言。A computational flow graph is constructed based on each node in the abstract syntax tree, and the computational flow graph is used as the first language.
在一些实施例中,确定模块包括排序子模块,排序子模块具体用于:In some embodiments, the determination module includes a sorting submodule, and the sorting submodule is specifically used to:
获取计算流图中的通路数量和通路特征;Obtain the number and characteristics of paths in the computational flow graph;
基于通路数量和通路特征对计算流图中的各个操作流程进行排序。The operation processes in the computational flow graph are sorted based on the number of paths and path characteristics.
在一些实施例中,转换模块具体用于:In some embodiments, the conversion module is specifically used to:
将符合预设执行规则的第一语言确定为通用语言,生成通用语言对应的第一执行指令,并将第一执行指令与通用语言进行绑定;Determine a first language that complies with a preset execution rule as a universal language, generate a first execution instruction corresponding to the universal language, and bind the first execution instruction to the universal language;
将不符合预设执行规则的第一语言确定为非通用语言,将非通用语言转换成符合预设执行规则的第二语言,生成第二语言对应的第二执行指令,并将第二执行指令与第二语言进行绑定。A first language that does not conform to a preset execution rule is determined as a non-universal language, the non-universal language is converted into a second language that conforms to the preset execution rule, a second execution instruction corresponding to the second language is generated, and the second execution instruction is bound to the second language.
在一些实施例中,转换模块包括规则子模块,规则子模块具体用于:In some embodiments, the conversion module includes a rule submodule, and the rule submodule is specifically used to:
基于非通用语言与各个待获取仿真数据之间的关联关系、非通用语言对应的仿真数据获取需求和预设执行规则确定非通用语言的转换规则;Determine a conversion rule for the non-universal language based on an association relationship between the non-universal language and each simulation data to be acquired, a simulation data acquisition requirement corresponding to the non-universal language, and a preset execution rule;
基于转换规则对非通用语言进行语言转换,得到符合预设执行规则的第二语言。Based on the conversion rules, the non-universal language is converted into a second language that meets the preset execution rules.
在一些实施例中,转换模块还包括验证子模块,验证子模块具体用于:In some embodiments, the conversion module further includes a verification submodule, and the verification submodule is specifically used to:
基于转换规则对非通用语言进行语言转换,得到初始第二语言;Perform language conversion on the non-universal language based on conversion rules to obtain an initial second language;
调用仿真程序对初始第二语言进行验证,得到初始仿真数据;Calling a simulation program to verify the initial second language and obtain initial simulation data;
在初始仿真数据符合预期数据范围的情况下,将初始第二语言作为第二语言。In the case where the initial simulation data meets the expected data range, the initial second language is used as the second language.
在一些实施例中,配置模块具体用于:In some embodiments, the configuration module is specifically configured to:
提取仿真数据获取过程中的获取信息,获取信息包括仿真工具使用的接口信息和过程数据的调用路径;Extracting acquisition information during the simulation data acquisition process, the acquisition information includes interface information used by the simulation tool and the calling path of the process data;
基于获取信息定义仿真工具的配置参数,以对仿真工具进行配置。Configuration parameters of the simulation tool are defined based on the acquired information to configure the simulation tool.
图4为本申请实施例提供的基于电路系统级模型的建模仿真装置的结构示意图之二,如图4所示,该装置包括解析模块410、分析模块420、改写模块430,以及计算和后处理模块440。FIG4 is a second structural schematic diagram of a modeling and simulation device based on a circuit system-level model provided in an embodiment of the present application. As shown in FIG4 , the device includes a parsing module 410 , an analysis module 420 , a rewriting module 430 , and a calculation and post-processing module 440 .
解析模块、用于根据用户的仿真数据获取需求得到用户层指令流,解析用户层指令流得到用户层指令流对应的AST。The parsing module is used to obtain the user layer instruction stream according to the user's simulation data acquisition requirements, and parse the user layer instruction stream to obtain the AST corresponding to the user layer instruction stream.
分析模块、用于分析AST,并根据AST得到第一语言。The analysis module is used to analyze the AST and obtain the first language according to the AST.
改写模块、用于改写第一语言得到第二语言。The rewriting module is used for rewriting the first language to obtain the second language.
计算和后处理模块、用于执行第二语言的执行指令并提取调用记录,向用户输出仿真数据和仿真工具的DSL定义。The calculation and post-processing module is used to execute the execution instructions of the second language and extract the call records, and output the simulation data and the DSL definition of the simulation tool to the user.
在此需要说明的是,本申请实施例提供的基于电路系统级模型的建模仿真装置,能够实现上述基于电路系统级模型的建模仿真方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted here that the modeling and simulation device based on the circuit system level model provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned modeling and simulation method embodiment based on the circuit system level model, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those of the method embodiment will not be described in detail here.
图5为本申请实施例提供的电子设备的结构示意图,如图5所示,该电子设备可以包括:处理器(Processor)510、通信接口(Communications Interface)520、存储器(Memory)530和通信总线(Communications Bus)540,其中,处理器510,通信接口520,存储器530通过通信总线540完成相互间的通信。处理器510可以调用存储器530中的逻辑命令,以执行上述方法,该方法包括:FIG5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. As shown in FIG5 , the electronic device may include: a processor (Processor) 510, a communication interface (Communications Interface) 520, a memory (Memory) 530 and a communication bus (Communications Bus) 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic command in the memory 530 to execute the above method, which includes:
接收用户的仿真数据获取需求;Receive users' simulation data acquisition requirements;
基于电路系统级模型的建模语言和仿真数据获取需求,确定仿真数据获取需求对应的第一语言;Based on the modeling language of the circuit system-level model and the simulation data acquisition requirement, determine the first language corresponding to the simulation data acquisition requirement;
将第一语言转换成符合预设执行规则的第二语言;Convert the first language into a second language that complies with preset execution rules;
执行第二语言,得到仿真数据获取需求对应的仿真数据和仿真数据的获取信息;executing the second language to obtain simulation data and simulation data acquisition information corresponding to the simulation data acquisition requirement;
基于获取信息对电路系统级模型中的仿真工具进行配置,以对电路进行建模。A simulation tool in a system level model of the circuit is configured based on the acquired information to model the circuit.
此外,上述的存储器中的逻辑命令可以通过软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干命令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the logic commands in the above-mentioned memory can be implemented in the form of software function modules and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several commands to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
本申请实施例提供的电子设备中的处理器可以调用存储器中的逻辑指令,实现上述方法,其具体的实施方式与前述方法实施方式一致,且可以达到相同的有益效果,此处不再赘述。The processor in the electronic device provided in the embodiment of the present application can call the logic instructions in the memory to implement the above method. Its specific implementation method is consistent with the implementation method of the aforementioned method and can achieve the same beneficial effects, which will not be repeated here.
本申请实施例还提供一种非暂态计算机可读的存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的方法。An embodiment of the present application also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the methods provided in the above embodiments are implemented.
其具体的实施方式与前述方法实施方式一致,且可以达到相同的有益效果,此处不再赘述。Its specific implementation is consistent with the aforementioned method implementation and can achieve the same beneficial effects, so it will not be repeated here.
本申请实施例提供一种计算机程序产品,包括计算机程序,计算机程序被处理器执行时实现如上述方法。An embodiment of the present application provides a computer program product, including a computer program, which implements the above method when executed by a processor.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311725533.1ACN117892665B (en) | 2023-12-14 | 2023-12-14 | Modeling simulation method, device, medium and equipment based on circuit system level model |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311725533.1ACN117892665B (en) | 2023-12-14 | 2023-12-14 | Modeling simulation method, device, medium and equipment based on circuit system level model |
| Publication Number | Publication Date |
|---|---|
| CN117892665A CN117892665A (en) | 2024-04-16 |
| CN117892665Btrue CN117892665B (en) | 2024-09-24 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311725533.1AActiveCN117892665B (en) | 2023-12-14 | 2023-12-14 | Modeling simulation method, device, medium and equipment based on circuit system level model |
| Country | Link |
|---|---|
| CN (1) | CN117892665B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118211547B (en)* | 2024-05-20 | 2024-08-09 | 山东云海国创云计算装备产业创新中心有限公司 | Chip modeling simulation method, product, equipment and medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021258363A1 (en)* | 2020-06-24 | 2021-12-30 | 华为技术有限公司 | Circuit reliability analysis method and apparatus, storage medium, and electronic equipment |
| CN116108777A (en)* | 2022-12-13 | 2023-05-12 | 宁夏理工学院 | Digital logic circuit simulation system and device based on HDL (hardware description language) of structure description mode |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105589736B (en)* | 2015-12-21 | 2019-03-26 | 西安电子科技大学 | Hardware description language based on netlist segmentation and multi-threaded parallel emulates accelerated method |
| CN107908830A (en)* | 2017-10-26 | 2018-04-13 | 北京动力机械研究所 | Model conversion method and model conversion system based on FMI standards |
| US10866885B2 (en)* | 2019-03-29 | 2020-12-15 | Intel Corporation | Programmatically generating software test libraries for functional safety |
| CN112153165B (en)* | 2020-11-27 | 2021-02-02 | 中国电力科学研究院有限公司 | A method, system, device and storage medium for constructing a power service simulation environment |
| CN113253708A (en)* | 2021-06-07 | 2021-08-13 | 卡斯柯信号(北京)有限公司 | Method and device for automatically generating simulation tool configuration file for signal system test |
| CN114416048A (en)* | 2021-12-17 | 2022-04-29 | 北京机电工程研究所 | Method and device for determining operation logic of UML model |
| CN114818558B (en)* | 2022-04-29 | 2025-03-25 | 湖南泛联新安信息科技有限公司 | A signal waveform storage method for logic simulation system |
| US20230376662A1 (en)* | 2022-05-17 | 2023-11-23 | Xilinx, Inc. | Circuit simulation based on an rtl component in combination with behavioral components |
| CN114638184B (en)* | 2022-05-23 | 2022-08-09 | 南昌大学 | Simulation method, system, storage medium and device for gate-level circuit |
| CN116954189A (en)* | 2023-04-12 | 2023-10-27 | 中国电力科学研究院有限公司 | Construction method of modularized and flexibly configured direct-current control protection test system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2021258363A1 (en)* | 2020-06-24 | 2021-12-30 | 华为技术有限公司 | Circuit reliability analysis method and apparatus, storage medium, and electronic equipment |
| CN116108777A (en)* | 2022-12-13 | 2023-05-12 | 宁夏理工学院 | Digital logic circuit simulation system and device based on HDL (hardware description language) of structure description mode |
| Publication number | Publication date |
|---|---|
| CN117892665A (en) | 2024-04-16 |
| Publication | Publication Date | Title |
|---|---|---|
| CN110008113B (en) | Test method and device and electronic equipment | |
| CN114399019B (en) | Neural network compiling method, system, computer equipment and storage medium | |
| CN108415826B (en) | Application test method, terminal device and computer-readable storage medium | |
| JPH11513512A (en) | Method of manufacturing digital signal processor | |
| CN105243018B (en) | A kind of class testing data creation method of object-oriented | |
| CN107797805B (en) | Code packaging method and device and computer readable storage medium | |
| US7367006B1 (en) | Hierarchical, rules-based, general property visualization and editing method and system | |
| CN117076335B (en) | Model test method, system, medium and electronic equipment | |
| CN117892665B (en) | Modeling simulation method, device, medium and equipment based on circuit system level model | |
| CN116127899A (en) | Chip design system, method, electronic device, and storage medium | |
| WO2008040748A1 (en) | Method and apparatus for the simultaneous multi-level and/or multi-simulator design optimization of electronic circuits | |
| CN118114604A (en) | Integrated file generation method and device, electronic equipment and storage medium | |
| CN116860589B (en) | Register verification method and device, electronic equipment and computer storage medium | |
| US9619598B2 (en) | Input space reduction for verification test set generation | |
| CN116126692A (en) | Algorithm tool automatic test system and method based on python | |
| CN115062571A (en) | Method, system, device and computer readable storage medium for dynamic selection of data region applied to integrated circuit device | |
| CN117873874A (en) | Interface element positioning method, system, medium and electronic equipment | |
| CN117271368A (en) | Page feasibility test method and device, computer equipment and storage medium | |
| CN117931623A (en) | Semiconductor parameter testing method and system based on interpreted high-level language | |
| CN115033434B (en) | Method and device for calculating kernel performance theoretical value and storage medium | |
| CN107506299B (en) | Code analysis method and terminal equipment | |
| CN112130841B (en) | SQL development method and device and terminal equipment | |
| CN115470740A (en) | Time sequence analysis method and device, electronic equipment and storage medium | |
| CN115292178A (en) | Test data searching method, device, storage medium and terminal | |
| CN113672509A (en) | Automated test method, device, test platform and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |