CN103077284B - Generic text template is utilized automatically to generate the method and system of auxiliary code file - Google Patents

Generic text template is utilized automatically to generate the method and system of auxiliary code file Download PDF

Info

Publication number
CN103077284B
CN103077284B CN201310016696.2A CN201310016696A CN103077284B CN 103077284 B CN103077284 B CN 103077284B CN 201310016696 A CN201310016696 A CN 201310016696A CN 103077284 B CN103077284 B CN 103077284B
Authority
CN
China
Prior art keywords
auxiliary code
code file
file
global variable
text template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201310016696.2A
Other languages
Chinese (zh)
Other versions
CN103077284A (en
Inventor
陈弟虎
郑洪滨
方溢西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Sun Yat Sen University
Original Assignee
National Sun Yat Sen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Sun Yat Sen University filed Critical National Sun Yat Sen University
Priority to CN201310016696.2A priority Critical patent/CN103077284B/en
Publication of CN103077284A publication Critical patent/CN103077284A/en
Application granted granted Critical
Publication of CN103077284B publication Critical patent/CN103077284B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of method and system utilizing generic text template automatically to generate auxiliary code file, this system comprises acquiring unit, judges to be loaded into unit and generation unit.The method comprises: the high-level coded description file of A, acquisition algorithm and configuration file; B, content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then the functional process unit of loading for generating auxiliary code file automatically; C, perform functional process unit for generating auxiliary code file, so from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information extracted is loaded into generic text template, automatically generate auxiliary code file.The present invention can greatly reduce workload and the pressure of designer, and improves the efficiency of hardware design.The present invention is widely used in hardware design field.

Description

Generic text template is utilized automatically to generate the method and system of auxiliary code file
Technical field
The present invention relates to computer realm, particularly relate to a kind of generic text template that utilizes in High Level Synthesis instrument and automatically generate the method and system of auxiliary code file.
Background technology
In hardware circuit design process, realize except the Hardware code file of special algorithm except needing according to design, also need to write auxiliary code file, such as emulate test code file, for comprehensive code constraint file etc., can test and functional verification Hardware code like this, thus utilize constraint condition to generate the net table meeting constraint, finally complete and wholely design and develop flow process.
At present for High Level Synthesis instrument, the center of gravity of its exploitation is mainly placed on the Hardware code file of automatic generating calculation, and does not too much relate to for supporting dependence test, code constraint file generated.Therefore, High Level Synthesis instrument is used to carry out in the process of circuit design in reality, obtain one of them stage that the correct Hardware code file of function just completes design cycle, and follow-up phase still needs staff to write relevant auxiliary code file, could to test the Hardware code generated like this, comprehensive etc., and final complete execution is whole designs and develops flow process.But these auxiliary code document forms relevant to design are similar, content repetition rate is high, and for different designs, it only needs to revise corresponding module information, if therefore write described auxiliary code file in staff mode in each design process, extra work amount can be brought to designer like this, and greatly reduce design efficiency.
Summary of the invention
In order to solve the problems of the technologies described above, the object of this invention is to provide a kind of generic text template that utilizes that is simple, that be easy to realize and operate and automatically generating the method for auxiliary code file.
Another object of the present invention is to provide a kind of generic text template that utilizes being easy to realize and operate and automatically generates the system of auxiliary code file.
The technical solution adopted in the present invention is: utilize generic text template automatically to generate the method for auxiliary code file, the method comprises:
The high-level coded description file of A, acquisition algorithm and configuration file corresponding thereto;
B, content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then the functional process unit of loading for generating auxiliary code file automatically, and perform step C;
C, perform functional process unit for generating auxiliary code file, so from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information extracted is loaded into generic text template, automatically generate auxiliary code file.
Further, the modular character information described in described step C comprises global variable characteristic information and Function feature information.
Further, described step C comprises:
C1, perform functional process unit for generating auxiliary code file, and then module searches is carried out to the high-level coded description file of algorithm;
C2, global variable traversal is carried out to the module found out, and then extract global variable characteristic information, and the global variable characteristic information extracted is loaded in the relevant position of generic text template;
C3, function traversal is carried out to the module found out, and then extract Function feature information, and the Function feature information extracted is loaded in the relevant position of generic text template;
C4, the generic text template of loaded global variable characteristic information sum functions characteristic information to be stored, and then automatically generate auxiliary code file.
Further, described generic text template comprises versatility code part and modular character part.
Further, described global variable characteristic information comprises global variable quantity, global variable address, global variable type, global variable attribute and the list of global variable initial value.
Further, described Function feature information comprises function name, function return value type, function parameter title, function parameter number and function parameter type.
Another technical scheme of the present invention is: utilize generic text template automatically to generate the system of auxiliary code file, this system comprises:
Acquiring unit, for the high-level coded description file of acquisition algorithm and configuration file corresponding thereto;
Judge to be loaded into unit, for the content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then automatically be loaded into the functional process unit for generating auxiliary code file, and perform generation unit;
Generation unit, for performing the functional process unit for generating auxiliary code file, and then from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information that extracts is loaded into generic text template, automatically generate auxiliary code file.
Further, described modular character information comprises global variable characteristic information and Function feature information.
Further, described generation unit comprises:
Module is searched in execution, for performing the functional process unit for generating auxiliary code file, and then carries out module searches to the high-level coded description file of algorithm;
First traversal insmods, and for carrying out global variable traversal to the module found out, and then extracts global variable characteristic information, and is loaded in the relevant position of generic text template by the global variable characteristic information extracted;
Second traversal insmods, and for carrying out function traversal to the module found out, and then extracts Function feature information, and is loaded in the relevant position of generic text template by the Function feature information extracted;
File generating module, for the generic text template of loaded global variable characteristic information sum functions characteristic information being stored, and then generates auxiliary code file automatically.
Further, described generic text template comprises versatility code part and modular character part.
The invention has the beneficial effects as follows: the method for the application of the invention, automatically can generate and design relevant auxiliary code file, and then for hardware design subsequent step, so then write auxiliary code file without the need to staff, greatly reduce workload and the pressure of designer, and bring great convenience for designer, and also significantly increase the efficiency utilizing High Level Synthesis instrument to carry out hardware design.
Another beneficial effect of the present invention is: the system of the application of the invention, automatically can generate and design relevant auxiliary code file, and then for hardware design subsequent step, so then write auxiliary code file without the need to staff, greatly reduce workload and the pressure of designer, and bring great convenience for designer, and also significantly increase the efficiency utilizing High Level Synthesis instrument to carry out hardware design.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described further:
Fig. 1 is that the present invention utilizes generic text template automatically to generate the block diagram of the method for auxiliary code file;
Fig. 2 is that the present invention utilizes generic text template automatically to generate the block diagram of method one specific embodiment of auxiliary code file;
Fig. 3 is that the present invention utilizes generic text template automatically to generate the structured flowchart of the system of auxiliary code file;
Fig. 4 is that the present invention utilizes generic text template automatically to generate the structured flowchart of system one specific embodiment of auxiliary code file.
Embodiment
Shown in Fig. 1 and Fig. 2, utilize generic text template automatically to generate the method for auxiliary code file, the method comprises:
The high-level coded description file of A, acquisition algorithm and configuration file corresponding thereto, the basic structure of the high-level coded description file of described algorithm is module, and the module in the high-level coded description file of described algorithm comprises global variable sum functions;
B, content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then the functional process unit of loading for generating auxiliary code file automatically, and perform step C;
C, perform functional process unit for generating auxiliary code file, so from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information extracted is loaded into generic text template, automatically generate auxiliary code file.
Be further used as preferred embodiment, the modular character information described in described step C comprises global variable characteristic information and Function feature information.
Be further used as preferred embodiment, described step C comprises:
C1, perform functional process unit for generating auxiliary code file, and then module searches is carried out to the high-level coded description file of algorithm;
C2, global variable traversal is carried out to the module found out, and then extract global variable characteristic information, and the global variable characteristic information extracted is loaded in the relevant position of generic text template;
C3, function traversal is carried out to the module found out, and then extract Function feature information, and the Function feature information extracted is loaded in the relevant position of generic text template;
C4, the generic text template of loaded global variable characteristic information sum functions characteristic information to be stored, and then automatically generate auxiliary code file.
Be further used as preferred embodiment, described generic text template comprises versatility code part and modular character part.Described versatility code part comprises basic format for generating object code file and Versatile content framework, and described modular character part is for being loaded into global variable characteristic information sum functions characteristic information.
Be further used as preferred embodiment, described global variable characteristic information comprises global variable quantity, global variable address, global variable type, global variable attribute and the list of global variable initial value.
Be further used as preferred embodiment, described Function feature information comprises function name, function return value type, function parameter title, function parameter number and function parameter type.
And when the present invention is applied in High Level Synthesis instrument, its concrete implementation step is as follows:
S1, operation High Level Synthesis instrument, read in the high-level coded description file of algorithm and configuration file corresponding thereto, i.e. the high-level coded description file of acquisition algorithm and configuration file corresponding thereto;
S2, content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then while the original functional process unit of reservation High Level Synthesis instrument, in High Level Synthesis instrument, being automatically loaded into the functional process unit for generating auxiliary code file, and performing step S3, otherwise, then only realize the original functional process unit of High Level Synthesis instrument, i.e. the Hardware code file of only generating algorithm;
S3, perform functional process unit for generating auxiliary code file, and then module searches is carried out to the high-level coded description file of algorithm;
S4, use High Level Synthesis instrument carry out global variable traversal to the module found out, and then extract global variable characteristic information, and be loaded in the relevant position of generic text template by the global variable characteristic information extracted;
S5, use High Level Synthesis instrument carry out function traversal to the module found out, and then extract Function feature information, and be loaded in the relevant position of generic text template by the Function feature information extracted;
S6, the generic text template of loaded global variable characteristic information sum functions characteristic information to be stored, and then automatically generate auxiliary code file, for subsequent design step.
Shown in Fig. 3 and Fig. 4, utilize generic text template automatically to generate the system of auxiliary code file, this system comprises:
Acquiring unit, for the high-level coded description file of acquisition algorithm and configuration file corresponding thereto, and the basic structure of the high-level coded description file of described algorithm is module, and the module in the high-level coded description file of described algorithm comprises global variable sum functions;
Judge to be loaded into unit, for the content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then automatically be loaded into the functional process unit for generating auxiliary code file, and perform generation unit;
Generation unit, for performing the functional process unit for generating auxiliary code file, and then from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information that extracts is loaded into generic text template, automatically generate auxiliary code file.
Be further used as preferred embodiment, described modular character information comprises global variable characteristic information and Function feature information.And described global variable characteristic information comprises global variable quantity, global variable address, global variable type, global variable attribute and the list of global variable initial value, and described Function feature information comprises function name, function return value type, function parameter title, function parameter number and function parameter type.
Be further used as preferred embodiment, described generation unit comprises:
Module is searched in execution, for performing the functional process unit for generating auxiliary code file, and then carries out module searches to the high-level coded description file of algorithm;
First traversal insmods, and for carrying out global variable traversal to the module found out, and then extracts global variable characteristic information, and is loaded in the relevant position of generic text template by the global variable characteristic information extracted;
Second traversal insmods, and for carrying out function traversal to the module found out, and then extracts Function feature information, and is loaded in the relevant position of generic text template by the Function feature information extracted;
File generating module, for the generic text template of loaded global variable characteristic information sum functions characteristic information being stored, and then generates auxiliary code file automatically.
Be further used as preferred embodiment, described generic text template comprises versatility code part and modular character part.Described versatility code part comprises basic format for generating object code file and Versatile content framework, and described modular character part is for being loaded into global variable characteristic information sum functions characteristic information.
Obtain according to above-mentioned, the present invention automatically can generate and design relevant auxiliary code file, and then for hardware design subsequent step, so then write auxiliary code file without the need to staff, greatly reduce workload and the pressure of designer, and bring great convenience for designer, and also significantly increase the efficiency utilizing High Level Synthesis instrument to carry out hardware design.
More than that better enforcement of the present invention is illustrated, but the invention is not limited to described embodiment, those of ordinary skill in the art also can make all equivalent variations or replacement under the prerequisite without prejudice to spirit of the present invention, and these equivalent distortion or replacement are all included in the application's claim limited range.

Claims (6)

1. utilize generic text template automatically to generate the method for auxiliary code file, it is characterized in that: the method comprises:
The high-level coded description file of A, acquisition algorithm and configuration file corresponding thereto;
B, content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then the functional process unit of loading for generating auxiliary code file automatically, and perform step C;
C, perform functional process unit for generating auxiliary code file, so from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information extracted is loaded into generic text template, automatically generate auxiliary code file;
Modular character information described in described step C comprises global variable characteristic information and Function feature information;
Described step C comprises:
C1, perform functional process unit for generating auxiliary code file, and then module searches is carried out to the high-level coded description file of algorithm;
C2, global variable traversal is carried out to the module found out, and then extract global variable characteristic information, and the global variable characteristic information extracted is loaded in the relevant position of generic text template;
C3, function traversal is carried out to the module found out, and then extract Function feature information, and the Function feature information extracted is loaded in the relevant position of generic text template;
C4, the generic text template of loaded global variable characteristic information sum functions characteristic information to be stored, and then automatically generate auxiliary code file.
2. utilize generic text template automatically to generate the method for auxiliary code file according to claim 1, it is characterized in that: described generic text template comprises versatility code part and modular character part.
3. utilize generic text template automatically to generate the method for auxiliary code file according to claim 1, it is characterized in that: described global variable characteristic information comprises global variable quantity, global variable address, global variable type, global variable attribute and the list of global variable initial value.
4. utilize generic text template automatically to generate the method for auxiliary code file according to claim 1, it is characterized in that: described Function feature information comprises function name, function return value type, function parameter title, function parameter number and function parameter type.
5. utilize generic text template automatically to generate the system of auxiliary code file, it is characterized in that: this system comprises:
Acquiring unit, for the high-level coded description file of acquisition algorithm and configuration file corresponding thereto;
Judge to be loaded into unit, for the content according to configuration file, and then judge whether to need to be loaded into the functional process unit for generating auxiliary code file, if the result judged is yes, then automatically be loaded into the functional process unit for generating auxiliary code file, and perform generation unit;
Generation unit, for performing the functional process unit for generating auxiliary code file, and then from the high-level coded description file of algorithm extraction module characteristic information, and after the modular character information that extracts is loaded into generic text template, automatically generate auxiliary code file;
Described modular character information comprises global variable characteristic information and Function feature information;
Described generation unit comprises:
Module is searched in execution, for performing the functional process unit for generating auxiliary code file, and then carries out module searches to the high-level coded description file of algorithm;
First traversal insmods, and for carrying out global variable traversal to the module found out, and then extracts global variable characteristic information, and is loaded in the relevant position of generic text template by the global variable characteristic information extracted;
Second traversal insmods, and for carrying out function traversal to the module found out, and then extracts Function feature information, and is loaded in the relevant position of generic text template by the Function feature information extracted;
File generating module, for the generic text template of loaded global variable characteristic information sum functions characteristic information being stored, and then generates auxiliary code file automatically.
6. utilize generic text template automatically to generate the system of auxiliary code file according to claim 5, it is characterized in that: described generic text template comprises versatility code part and modular character part.
CN201310016696.2A 2013-01-16 2013-01-16 Generic text template is utilized automatically to generate the method and system of auxiliary code file Expired - Fee Related CN103077284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310016696.2A CN103077284B (en) 2013-01-16 2013-01-16 Generic text template is utilized automatically to generate the method and system of auxiliary code file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310016696.2A CN103077284B (en) 2013-01-16 2013-01-16 Generic text template is utilized automatically to generate the method and system of auxiliary code file

Publications (2)

Publication Number Publication Date
CN103077284A CN103077284A (en) 2013-05-01
CN103077284B true CN103077284B (en) 2016-01-13

Family

ID=48153813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310016696.2A Expired - Fee Related CN103077284B (en) 2013-01-16 2013-01-16 Generic text template is utilized automatically to generate the method and system of auxiliary code file

Country Status (1)

Country Link
CN (1) CN103077284B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106599370B (en) * 2016-11-16 2019-12-13 中山大学 automatic generation method and system for guide file in high-level comprehensive tool
CN113378515B (en) * 2021-08-16 2021-11-02 宜科(天津)电子有限公司 Text generation system based on production data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040163072A1 (en) * 2003-02-19 2004-08-19 Royal Design Ltd. Electronic design automation with automatic generation of hardware description language (HDL) code

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
基于EJB组件的代码自动生成平台的研究——代码生成器及模板库的设计;张锦;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;20040915(第2004年第03期);I138-169 *
基于动词属性的模板化自动代码生成;汪畅 等;《计算机技术与发展》;20100531;第20卷(第5期);104-107 *
基于模型集成计算的领域建模研究与应用;程东武;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;20110515(第2011年第05期);正文第4章 *
基于模板技术的J2EE应用代码自动化生成工具的设计与开发;马春波;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;20111215(第2011年第S1期);I138-509 *
通用指令集描述语言的设计和实现;赵军;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;20060515(第2006年第05期);I138-187 *

Also Published As

Publication number Publication date
CN103077284A (en) 2013-05-01

Similar Documents

Publication Publication Date Title
CN110032369A (en) A kind of code automatic generation method, device and medium
CN104461484B (en) The implementation method and device of front-end template
CN103309806B (en) The device and method of a kind of quick development and testing
CN104965714A (en) Code generation method and system of application software
CN104331285A (en) Automatic code generation method and system
CN106648587A (en) Annotation-based Web application code generation method
CN104063365B (en) The method that object is inserted into PDF document
CN103677821A (en) Method and device for publishing software development tool code
CN103823793A (en) Realizing method for dynamic report based on Excel template
CN104809068A (en) Web automatic testing framework construction method based on selenium
CN104731588B (en) Page layout document generating method and page layout file creating apparatus
CN101859303A (en) Metadata management method and management system
CN105095160A (en) Document conversion reading method and system
CN106951254B (en) Method and device for multiplexing similar service function modules in payment system
CN105528418A (en) Design document generation method and apparatus
CN102298740A (en) Business process management supporting method
CN108509199A (en) Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation
CN101093513A (en) Method and system for solving issue of supporting multilanguage of computer software
CN104615431A (en) Method and device for achieving Web application
CN105354236A (en) Reconciliation information generation method and system
CN105574041A (en) Data reconstruction method and device
Yie et al. Advanced traceability for ATL
CN103164393A (en) Method and system of report formula processing
CN103077284B (en) Generic text template is utilized automatically to generate the method and system of auxiliary code file
CN104699473A (en) Timing constraint file generation method and device and RTL (Register Transfer Level) simulation equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160113

Termination date: 20180116