CN101770388A - Method and device for obtaining chip code information - Google Patents

Method and device for obtaining chip code information Download PDF

Info

Publication number
CN101770388A
CN101770388A CN200910001370A CN200910001370A CN101770388A CN 101770388 A CN101770388 A CN 101770388A CN 200910001370 A CN200910001370 A CN 200910001370A CN 200910001370 A CN200910001370 A CN 200910001370A CN 101770388 A CN101770388 A CN 101770388A
Authority
CN
China
Prior art keywords
register
information
code information
chip code
module
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.)
Pending
Application number
CN200910001370A
Other languages
Chinese (zh)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN200910001370A priority Critical patent/CN101770388A/en
Publication of CN101770388A publication Critical patent/CN101770388A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the invention discloses a method and a device for obtaining chip code information, which belong to the filed of electronic equipment. The method comprises the following steps: generating a register list including register information according to user instructions, wherein the register information includes register public information and register parameter information, a register name and a domain name in the register parameter information are named according to a naming specification of the specified program language, and the address calculation in the register parameter information adopts an expression capable of being identified by the specified target program language; reading the register information; carrying out validity check on the register information; and analyzing the register information when the check result shows the validity of the register information, and generating the chip code information. The device comprises a first generation module, a reading module, a check module and a second generating module. The embodiment of the invention generates the chip code information on the basis of the automation, can reduce the development cost, can improve the chip reliability, and can accelerate the chip application.

Description

Obtain the method and apparatus of chip code information
Technical field
The present invention relates to electronic device field, particularly a kind of method and apparatus that obtains chip code information.
Background technology
The function that the chip in fields such as computing machine in the past, data communication is realized is all more single, and the register scale is less, generally has only tens up to a hundred, and the manual coding that carries out chip drives information at these registers does not need a lot of time.But along with the reinforcement of chip realization function, the register scale is doubled and redoubled, for example, the register scale of present data communication field business chip has up to ten thousand, at this moment, continues to adopt manual coding, the construction cycle of chip drives information will be doubled and redoubled, and cost of development increases; And introduce human error easily, reliability is low, is unfavorable for the quick application of chip.
Summary of the invention
The embodiment of the invention provides a kind of method and apparatus that obtains chip code information, can reduce cost of development, improves chip reliability.
Described technical scheme is as follows:
The embodiment of the invention provides a kind of method of obtaining chip code information, comprising:
Generate the register tabulation that comprises register information according to user instruction, described register information comprises register public information and register parameters information, register name in the described register parameters information and domain name are according to the Naming conventions name of the object program language of appointment, and the address computation in the described register parameters information adopts the discernible expression formula of object program language of appointment;
Read described register information;
Described register information is carried out validity checking;
Described register information is resolved when legal when described register information is checked, generate described chip code information.
The embodiment of the invention provides a kind of device that obtains chip code information, comprising:
First generation module, be used for generating the register tabulation that comprises register information according to user instruction, described register information comprises register public information and register parameters information, register name in the described register parameters information and domain name are according to the Naming conventions name of the object program language of appointment, and the address computation in the described register parameters information adopts the discernible expression formula of object program language of appointment;
Read module is used to read described register information;
Check module, be used for described register information is carried out validity checking;
Second generation module is used for when described inspection module described register information being checked and described register information is resolved when legal, generates described chip code information.
In the present embodiment, the chip code information based on robotization generates can improve software development efficiency, reduces cost of labor; Can eliminate the human error that manual coding may be introduced, improve the reliability of software, thereby realize the quick application of chip, improve the competitive power of chip.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do one to the accompanying drawing of required use in embodiment or the description of the Prior Art below introduces simply, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the process flow diagram of the method for obtaining chip code information that provides of the embodiment of the invention 1;
Fig. 2 is the structural drawing of the device that obtains chip code information that provides of the embodiment of the invention 3.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.Obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention 1 provides a kind of method of obtaining chip code information, as shown in Figure 1, comprising:
Step 101: generate the register tabulation that comprises register information according to user instruction, described register information comprises register public information and register parameters information, register name in the described register parameters information and domain name are according to the Naming conventions name of the target program program language of appointment, and the address computation in the described register parameters information adopts the discernible expression formula of target program program language of appointment;
Step 102: read this register information;
Step 103: this register information is carried out validity checking;
Step 104: this register information is resolved when legal when this register information is checked, generate this chip code information.
Further, this register information is resolved, the step that generates this chip code information comprises:
Generate the target program unit of this register correspondence at each register, generate the file destination that can compile according to the way of compiling control information of target program unit that generates and file, with this file destination that can compile as chip code information
Further, the method for obtaining chip code information that present embodiment provides also comprises:
When register information being checked when illegal, stop to check, and the alarm mistake.
Need to prove that when file destination was the target program source file, this chip code information was for driving code information; Or
When file destination was the target test script file, this chip code information was a test code information.
In the present embodiment, the chip code information based on robotization generates can improve software development efficiency, reduces cost of labor; Can eliminate the human error that manual coding may be introduced, improve the reliability of software, thereby realize the quick application of chip, improve the competitive power of chip.
Be that the driving code information of the register of c is an example to generate object program language below, be described in detail by 2 pairs of present embodiments 1 of the embodiment of the invention.
The method of the generation activation bit that the embodiment of the invention 2 provides comprises the steps:
Step 201: according to the register tabulation of user instruction generation based on the Microsoft Excel form.
At first, the needs register that just can finish a certain specific function that coacts is joined together to form module one by one, can improve the globality of each module like this.Simultaneously, be that each module generates a register tabulation, the base address of each module name, module is different with each register parameters information in the register tabulation.
Particularly, the instruction that receives the user generates the register tabulation, receives the register information of user's input then, and this register information comprises: the public information of register and the parameter information of register.In embodiments of the present invention, the register xxx_state1 that the needs of reception user input coact and just can finish the Port Management function, the information of xxx_state2, xxx_Cfg, register tabulation as shown in table 1, wherein, register xxx_Cfg comprises: two territories of xxx_Cfg1 and xxx_Cfg2.
Figure G2009100013706D0000041
Wherein, the 1st row the 2nd in the table 1 is classified module name (Module Name), the 2nd row the 2nd as and is classified base address (Address), the 3rd row the 2nd of module as and classify paper writer (File Author) information as, wherein, the base address of module name, module and paper writer information are referred to as the public information of register.Wherein, module name can be used as the target source program filename, also will be as the part of the function name that generates, and for example, in the present embodiment, module is called " port ", and then the target program source filename of Sheng Chenging is " port.c "; The function that generates " set_port_xxx_cfg1 " by name, " set_port_xxx_cfg2 " etc., port is used for identifying these functions and belongs to " port " this functional module as the part of function name, and can the several uniqueness of the letter of guarantee.Paper writer information joins the file header of target program source file as description information of files.
4-5 in the table 1 is capable to be gauge outfit, is used for improving the readability of register tabulation, and processing procedure can not read the information of these two row.Wherein, the information of the 4th row is optionally, and the information of the 5th row is essential.
1-15 row since the 6th row in the table 1 are followed successively by: the title of register (Reg Name), the functional description of register (Reg Comment), the address computation expression formula (Offset) of register, the bit wide of register (Width), registers group sign (Group), member's number expression formula (Num) of registers group, member's address offset expression formula (Step) of registers group, register read-write attribute (Attribute), register reset values (Init), the title in territory (Mem Name), the bit in territory (Bit), the read-write properties in territory (Attribute), the reset values in territory (Init), the functional description (Comment) in span in territory (Contraint) and territory, these information can be referred to as the parameter information of register.Wherein, the parameter information of the 6th behavior register xxx_state1 of table 1, the 1st to the 9th of the 7th row is classified the parameter information of register xxx_Cfg as, and it is the public information of territory xxx_Cfg1 and territory xxx_Cfg2; The the 10th to 15 of eighth row is classified the parameter information of territory xxx_Cfg1 as, and the 10th to 15 of the 9th row is classified the parameter information of territory xxx_Cfg2 as.
In the present embodiment, the something in common of the register tabulation shown in the table 2 is in the register shown in the table 1 tabulation and the prior art: the register tabulation shown in the table 2 is unified for the definition of the bit in territory, read-write properties, reset values in the register tabulation shown in the table 1 and the prior art; Difference is: the register tabulation in the prior art shown in the table 2 does not have unified standard in the name of register name and domain name in the expression of address, and different register is relatively more independent each other; And unified Naming conventions is adopted in the tabulation of the register shown in the table 1 in the name of register name and domain name, in the present embodiment, the name of register name and domain name is carried out according to the Naming conventions of c language, for example, name to register and territory can only be adopted capital and small letter English alphabet, numeral and underscore, and initial character can only be English alphabet; Represent in the address of register, address computation mode with natural language description, be converted into the discernible expression formula of a kind of target program c language, for example, the 0x1000+i+m of the 6th row the 3rd row in the table 1, by this expression formula of 6-7 row assisted analysis with delegation, final address computation mode is 0x1000+i*128+m*4, the span of i is 0~3, and the span of m is 0~15.
Figure G2009100013706D0000061
Table 2
Step 202: read the register information in the register tabulation.
Particularly, utilize the VBA editing machine of EXCEL to read register information in the register tabulation, comprise the public information that once reads register and read register parameters information line by line.
Step 203: the register information that reads is carried out validity checking.
Particularly, by string analysis and calculating register information is carried out validity checking, for example, title according to register and territory can only be the naming rule of " capital and small letter English alphabet, numeral and underscore; initial character can only be English alphabet ", and whether there is unallowable instruction digit the centre to the title in inspection register and territory; Whether by analyzing character string is that 10 systems or 16 systems are represented, again character string is converted into numerical value, and whether address identical or registers group can be overlapping to calculate the address of register of same module then, and whether calculate bit field identical or overlapping etc.
Step 204: after legal to the register information inspection of reading, the register information that reads is resolved, generate corresponding target program unit at each register, generate the target program source file that can compile after the target program unit that generates being added the way of compiling control information of necessary file, i.e. the chip code information of register.
Particularly, read the public information of the register that 1-3 is capable in the table 1: the base address of module name, module and paper writer information; Read the parameter information of the register xxx_state1 of the 6th row, and resolve, generate target program unit A, this target program unit A comprises: address macro definition, bit field macro definition and interface function set_port_xxx_state1, this interface function are used for reading information from register xxx_state1; Read 7-9 capable in the parameter information of register xxx_Cfg1 and xxx_Cfg2, and resolve, generate target program unit B and C, wherein, the target program unit B comprises: address macro definition, bit field macro definition and interface function set_port_xxx_Cfg1, get_port_xxx_Cfg1, wherein, this interface function set_portxxx_Cfg1 is used for the writing information to register xxx_Cfg1, and interface function get_port_xxx_Cfg1 is used for reading information from register xxx_Cfg1.Target program unit C comprises: address macro definition, bit field macro definition and interface function set_portxxx_Cfg2, get_port_xxx_Cfg2, wherein, this interface function set_portxxx_Cfg2 is used for the writing information to register xxx_Cfg2, and interface function get_port_xxx_Cfg2 is used for reading information from register xxx_Cfg2.Read the parameter information of the register xxx_state2 of the 10th row, and resolve, generate the target program cells D, wherein, the target program cells D comprises: address macro definition, bit field macro definition and interface function get_port_xxx_state2, this interface function are used for reading information from register xxx_state2.
The target program unit A, B, C and the D that generate are made up, and the way of compiling control information of adding necessary file generates the target program source file port.c that can compile.Wherein, the way of compiling control information of Bi Yao file comprises: macro definition of file description information, necessity and compile option etc.Target program source file port.c comprises: macro definition, address macro definition, bit field macro definition and the interface function etc. of file description information, compile option, necessity.
Further,, stop to check when register information being checked when illegal, and the alarm mistake.
Need to prove that in the present embodiment, the form of register tabulation can be adjusted according to parameter and processing demands; Selecting for use on the spreadsheet instrument, be not limited to Microsoft Excel, only need to support the reading of content of scripting to handle and output with suitable character string; Being not limited to the document convention of target program c language, also can be the rule of other object program languages, for example, and VB language, java language etc.
In the present embodiment, the chip code information based on robotization generates can improve software development efficiency, reduces cost of labor; Can eliminate the human error that manual coding may be introduced, improve the reliability of software, thereby realize the quick application of chip, improve the competitive power of chip.
The embodiment of the invention 3 provides a kind of device that obtains chip code information, as shown in Figure 2, comprises
First generation module 301, be used for generating the register tabulation that comprises register information according to user instruction, this register information comprises register public information and register parameters information, register name in this register parameters information and domain name are according to the Naming conventions name of the object program language of appointment, and the address computation in this register parameters information adopts the discernible expression formula of object program language of appointment;
Read module 302 is used to read this register information;
Check module 303, be used for this register information is carried out validity checking;
Second generation module 304 is used for when this inspection module this register information being checked and this register information is resolved when legal, generates this chip code information.
Further, this second generation module 304, be used for generating the target program unit of this register correspondence at each register, way of compiling control information according to target program unit that generates and file generates the file destination that can compile, with this file destination that can compile as this chip code information.
Further, this device also comprises:
Alarm module is used for when this inspection module this register information being checked when illegal, stops to check, and the alarm mistake.
Need to prove that when file destination was the target program source file, this chip code information was for driving code information; Or
When file destination was the target test script file, this chip code information was a test code information.
In the present embodiment, the chip code information based on robotization generates can improve software development efficiency, reduces cost of labor; Save basic unit testing, improve testing efficiency; Can eliminate the human error that manual coding may be introduced, improve the reliability of software, thereby realize the quick application of chip, improve the competitive power of chip.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, described program can be stored in the computer read/write memory medium, and described storage medium is floppy disk, hard disk or the CD etc. of computing machine.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a method of obtaining chip code information is characterized in that, comprising:
Generate the register tabulation that comprises register information according to user instruction, described register information comprises register public information and register parameters information, register name in the described register parameters information and domain name are according to the Naming conventions name of the object program language of appointment, and the address computation in the described register parameters information adopts the discernible expression formula of object program language of appointment;
Read described register information;
Described register information is carried out validity checking;
Described register information is resolved when legal when described register information is checked, generate described chip code information.
2. the method for obtaining chip code information as claimed in claim 1 is characterized in that, described described register information is resolved, and the step that generates described chip code information comprises:
Generate the target program unit of this register correspondence at each register, generate the file destination that can compile according to the way of compiling control information of target program unit that generates and file, with the described file destination that compiles as described chip code information.
3. the method for obtaining chip code information as claimed in claim 1 or 2 is characterized in that, also comprises:
When described register information being checked when illegal, stop to check, and the alarm mistake.
4. the method for obtaining chip code information as claimed in claim 3 is characterized in that,
When described file destination was the target program source file, described chip code information was for driving code information; Or
When described file destination was the target test script file, described chip code information was a test code information.
5. a device that obtains chip code information is characterized in that, comprising:
First generation module, be used for generating the register tabulation that comprises register information according to user instruction, described register information comprises register public information and register parameters information, register name in the described register parameters information and domain name are according to the Naming conventions name of the object program language of appointment, and the address computation in the described register parameters information adopts the discernible expression formula of object program language of appointment;
Read module is used to read described register information;
Check module, be used for described register information is carried out validity checking;
Second generation module is used for when described inspection module described register information being checked and described register information is resolved when legal, generates described chip code information.
6. the device that obtains chip code information as claimed in claim 5, it is characterized in that, described second generation module, be used for generating the target program unit of this register correspondence at each register, way of compiling control information according to target program unit that generates and file generates the file destination that can compile, with the described file destination that compiles as described chip code information.
7. as claim 5 or the 6 described devices that obtain chip code information, it is characterized in that, also comprise:
Alarm module is used for when described inspection module described register information being checked when illegal, stops to check, and the alarm mistake.
8. the device that obtains chip code information as claimed in claim 7 is characterized in that, when described file destination was the target program source file, described chip code information was for driving code information; Or
When described file destination was the target test script file, described chip code information was a test code information.
CN200910001370A 2009-01-06 2009-01-06 Method and device for obtaining chip code information Pending CN101770388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910001370A CN101770388A (en) 2009-01-06 2009-01-06 Method and device for obtaining chip code information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910001370A CN101770388A (en) 2009-01-06 2009-01-06 Method and device for obtaining chip code information

Publications (1)

Publication Number Publication Date
CN101770388A true CN101770388A (en) 2010-07-07

Family

ID=42503267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910001370A Pending CN101770388A (en) 2009-01-06 2009-01-06 Method and device for obtaining chip code information

Country Status (1)

Country Link
CN (1) CN101770388A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402430A (en) * 2010-09-14 2012-04-04 无锡中星微电子有限公司 Method and system for generating random test case by using script
CN103744775A (en) * 2012-08-13 2014-04-23 德克萨斯仪器股份有限公司 Test case crash recovery
CN107506228A (en) * 2017-09-11 2017-12-22 珠海亿智电子科技有限公司 A kind of method that driving code is automatically generated according to chip handbook
CN108615500A (en) * 2018-05-11 2018-10-02 深圳市摩西尔电子有限公司 The control method of the cross-platform displays of LED
CN109977558A (en) * 2019-03-28 2019-07-05 苏州中晟宏芯信息科技有限公司 A kind of generation method, device and the storage medium of chip register code structure
CN113065315A (en) * 2021-03-25 2021-07-02 珠海市一微半导体有限公司 Conversion control method for file of description register
CN113312080A (en) * 2021-05-24 2021-08-27 眸芯科技(上海)有限公司 System for updating chip software and hardware configuration in chip EDA simulation and application
CN113515485A (en) * 2021-07-12 2021-10-19 合肥芯荣微电子有限公司 Automatic generation method for RTL code of SoC chip control register module

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206578A (en) * 2006-12-21 2008-06-25 旺玖科技股份有限公司 Method for starting chip type system and computer system medium thereof
CN101251800A (en) * 2008-04-01 2008-08-27 北京中星微电子有限公司 Graphical user interface creating method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206578A (en) * 2006-12-21 2008-06-25 旺玖科技股份有限公司 Method for starting chip type system and computer system medium thereof
CN101251800A (en) * 2008-04-01 2008-08-27 北京中星微电子有限公司 Graphical user interface creating method and apparatus

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402430A (en) * 2010-09-14 2012-04-04 无锡中星微电子有限公司 Method and system for generating random test case by using script
CN102402430B (en) * 2010-09-14 2016-03-09 无锡中感微电子股份有限公司 One utilizes script to generate random test example method and system
CN103744775A (en) * 2012-08-13 2014-04-23 德克萨斯仪器股份有限公司 Test case crash recovery
CN107506228A (en) * 2017-09-11 2017-12-22 珠海亿智电子科技有限公司 A kind of method that driving code is automatically generated according to chip handbook
CN108615500A (en) * 2018-05-11 2018-10-02 深圳市摩西尔电子有限公司 The control method of the cross-platform displays of LED
CN108615500B (en) * 2018-05-11 2019-12-03 深圳市摩西尔电子有限公司 The control method of the cross-platform display of LED
CN109977558A (en) * 2019-03-28 2019-07-05 苏州中晟宏芯信息科技有限公司 A kind of generation method, device and the storage medium of chip register code structure
CN113065315A (en) * 2021-03-25 2021-07-02 珠海市一微半导体有限公司 Conversion control method for file of description register
CN113312080A (en) * 2021-05-24 2021-08-27 眸芯科技(上海)有限公司 System for updating chip software and hardware configuration in chip EDA simulation and application
CN113312080B (en) * 2021-05-24 2024-04-19 眸芯科技(上海)有限公司 System, device and method for updating chip software and hardware configuration in chip EDA simulation
CN113515485A (en) * 2021-07-12 2021-10-19 合肥芯荣微电子有限公司 Automatic generation method for RTL code of SoC chip control register module
CN113515485B (en) * 2021-07-12 2024-04-02 合肥芯荣微电子有限公司 Automatic generation method of RTL code of SoC chip control register module

Similar Documents

Publication Publication Date Title
CN101770388A (en) Method and device for obtaining chip code information
CN106502896B (en) A kind of generation method and device of function test code
CN100399323C (en) Apparatus and method for parsing xml document by using external xml validator
CN107544808A (en) The generation method and device of a kind of web form
CN107436762A (en) A kind of register Code document generating method, device and electronic equipment
CN101699397A (en) Method for binding Java and XML data
CN104572463A (en) Method and device for testing interface information
CN102402430A (en) Method and system for generating random test case by using script
CN103488482A (en) Method and device for generating test cases
CN105068909A (en) Simulation test development platform for embedded storage
CN108920140A (en) Method of calibration is unified in a kind of front and back end
JP2012150535A (en) Program verification method and program verification program
CN103326930B (en) Open platform interface automatic detecting method and system
CN109446096A (en) A kind of intelligence contract adjustment method, device and its storage medium
CN111753140A (en) XML file parsing method and related equipment
CN105824647A (en) Form page generating method and device
CN102298577A (en) Method and device for detecting spelling of document edition
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN113094625B (en) Page element positioning method and device, electronic equipment and storage medium
Bernardo et al. A signal engine for a live coding language ecosystem
Fang et al. AssertLLM: Generating and Evaluating Hardware Verification Assertions from Design Specifications via Multi-LLMs
King Introduction to data acquisition with LabVIEW
CN112799655A (en) Multi-type code automatic generation method, device and medium based on pre-training
CN1115628C (en) Software simulation test method
CN115828856A (en) Test paper generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20100707