CN102662630A - Code generation method - Google Patents

Code generation method Download PDF

Info

Publication number
CN102662630A
CN102662630A CN2012101230798A CN201210123079A CN102662630A CN 102662630 A CN102662630 A CN 102662630A CN 2012101230798 A CN2012101230798 A CN 2012101230798A CN 201210123079 A CN201210123079 A CN 201210123079A CN 102662630 A CN102662630 A CN 102662630A
Authority
CN
China
Prior art keywords
signal
template
registers group
statement
bit wide
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.)
Granted
Application number
CN2012101230798A
Other languages
Chinese (zh)
Other versions
CN102662630B (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.)
RISING MICRO ELECTRONICS CO Ltd
Original Assignee
RISING MICRO ELECTRONICS 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 RISING MICRO ELECTRONICS CO Ltd filed Critical RISING MICRO ELECTRONICS CO Ltd
Priority to CN201210123079.8A priority Critical patent/CN102662630B/en
Publication of CN102662630A publication Critical patent/CN102662630A/en
Application granted granted Critical
Publication of CN102662630B publication Critical patent/CN102662630B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a code generation method which is used for generating instruction decoder codes. The code generation method can automatically generate the instruction decoder codes according to register block files output by a user, and the user only needs to generate the register block files formed by statements. Compared with the instruction decoder codes output by the user manually, the code generation method simplifies user operation, reduces work load of the user, and shortens work period. In addition, due to the fact that the register block files comprise less statements, probability of error occurred when the register block filers is generated by the user is low, and error caused by human reasons cannot occur in the process of instruction decoder codes generated automatically according to the register block files. Compared with an existing manual input instruction decoder code way, the code generation method can lowers probability of error of the codes.

Description

A kind of code generating method
Technical field
The invention belongs to the Design of Digital Circuit technical field, relate in particular to a kind of code generating method.
Background technology
In the design of chip, need through the operation of command decoder control entire chip and the running status of inquiry chip.(Application Specific Integrated Circuit, ASIC) in the design, the design of command decoder is realized by hardware program language verilog or VHSIC hardware description language (VHDL) code at special IC.
At present, mainly based on the manual input of accomplishing the command decoder code.
But; The signal of command decoder is a lot; And the change of instruction increase and decrease and putting position can appear in the process of design command decoder; Will accomplish the modification of existing code again by hand when a large amount of instruction increases and decreases of appearance, when putting position changes, this causes process of whole manual completion code input very loaded down with trivial details, workload big, the work period is very long.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of code generating method, can generate the command decoder code automatically according to the registers group file of user's input, to simplify user's design operation, reduce user's design effort amount, to shorten the work period.
For realizing above-mentioned purpose, the present invention provides following technical scheme:
A kind of code generating method is used to generate the command decoder code, and said method comprises:
Step S1: the registers group file that receives user's input;
Step S2: in said registers group file, obtain the registers group title according to first preset rules;
Step S3: call first template that prestores, utilize said registers group title to replace the registers group identifier in said first template, obtain first code segment;
Step S4: call the first template statement that prestores; Utilize said registers group title to replace the registers group identifier in the said first template statement; Obtain first statement, said first statement is inserted the primary importance place in second template that prestores, obtain second code segment;
Step S5: in said registers group file, obtain and the corresponding command signal of said registers group title according to second preset rules, and confirm the type of each command signal;
Step S6: utilize said each command signal that the 4th template that prestores is handled, obtain the 4th code segment, specifically comprise:
When said command signal is write signal, confirm the bit wide and the registers group bit wide of said write signal; Call the 3rd template that prestores; Utilize said write signal to replace signal identifiers in said the 3rd template, utilize said registers group title to replace registers group identifier in said the 3rd template, utilize the bit wide of said write signal to replace signal bit wide identifier in said the 3rd template, utilize said registers group bit wide to replace the registers group bit wide identifier in said the 3rd template, obtain third generation sign indicating number section; Said third generation sign indicating number section is inserted the end of the 4th current template; Character string to being made up of said write signal and bit wide thereof is added first prefix and second prefix respectively, generates two command signals, said two command signals is inserted the signal tabulation of said current the 4th template;
When said command signal is read signal, confirm the bit wide of said read signal; Call the second template statement that prestores, utilize said read signal to replace signal identifiers in the said second template statement, utilize the bit wide of said read signal to replace the signal bit wide identifier in the said second template statement, obtain second statement; Said second statement is inserted the end of the 4th current template; Character string to being made up of said read signal and bit wide thereof is added the 3rd prefix, generates new command signal, said new command signal is inserted the signal tabulation of current the 4th template;
When said command signal is register signal, confirm the bit wide of said register signal; Call the 3rd template statement that prestores, utilize said register signal to replace signal identifiers in said the 3rd template statement, utilize the bit wide of said register signal to replace the signal bit wide identifier of said the 3rd template statement, obtain the 3rd statement; Said the 3rd statement is inserted the end of the 4th current template; To insert the signal tabulation of current the 4th template by the character string that said register signal and bit wide thereof constitute;
Step S7: the end with said first code segment and second code segment insert said the 4th code segment successively forms the command decoder code.
Preferably, in said method, said command signal has the signal identification of distinguishing its type; Accordingly, confirm the type of each command signal according to the signal identification of said command signal.
Preferably, in said method, the signal identification of said read signal is prefix r_, and the signal identification of said write signal is prefix w_.
This shows; In the above-mentioned disclosed code generating method of the present invention; Can generate the command decoder code automatically according to the registers group file of user's output, the user only need generate the registers group file that is made up of declarative statement, compares with the manual output order decoder code of user; Simplify user's operation, reduced user's workload, and then shortened the work period; In addition; Because the statement that the registers group file comprises is less; It is lower that the user generates the probability that makes a mistake in the registers group file process; And can not make a mistake because of the artificial origin according to the process that the registers group file generates the command decoder code automatically, therefore to compare with the mode of existing manual input instruction decoder code, code generating method disclosed by the invention can reduce the probability that code makes a mistake.
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 to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below 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 a kind of code generating method disclosed by the invention.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer; To combine the accompanying drawing in the embodiment of the invention below; Technical scheme in the embodiment of the invention is carried out clear, intactly description; Obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The invention discloses a kind of code generating method, can generate the command decoder code automatically, can simplify user's operation, reduce amount of user effort, shorten the work period according to the registers group file of user's input.
Referring to Fig. 1, Fig. 1 is the process flow diagram of a kind of code generating method disclosed by the invention.Comprise:
Step S1: the registers group file that receives user's input.
The user collects various needed command signals; And it is divided into a plurality of registers group according to the function and the figure place of command signal; Name, list the bit wide of each command signal in the signal tabulation of this registers group, the bit wide of confirming this registers group and the signal tabulation afterwards for each registers group, generate the registers group file.This registers group file comprises the bit wide of registers group title, command signal, registers group and the bit wide of each command signal, and verilog writes by the hardware program language.Wherein command signal comprises a read signal, a write signal and registers group signal.
The code of a registers group file is following:
`define bit_TEMP{w_T_en, r_T_result [7:0], T_offset [6:0] } // the defined instruction signal
`define wr_TEMP{/* wdata [15], * // * wdata [14:8], */wdata [6:0] } // the corresponding read-write of defined instruction position
Step S2: in said registers group file, obtain the registers group title according to first preset rules.
The registers group file is write in strict accordance with the verilog grammer, therefore after obtaining the registers group file, just can confirm the registers group title.Concrete, this first preset rules can for: in the command signal definition statement in the registers group file, the character string that is positioned at behind the first preset key word is the registers group title.For example; The character string that is positioned in the command signal definition statement in the registers group file behind the key word " define bit_ " is the registers group title; The character string that perhaps is positioned in the command signal definition statement in the registers group file behind the key word " bit_ " is the registers group title, and the present invention does not limit the first preset key word.Certainly, first preset rules also can for: in the command signal definition statement in the registers group file, the character string between the second preset key word and the 3rd preset key word is the registers group title.For example; " character string between { " is the registers group title to be positioned at key word " bit_ " and key word in the command signal definition statement in the registers group file; The character string that perhaps is positioned in the command signal definition statement in the registers group file between key word " define bit_ " and the key word " { w_ " is the registers group title, and the present invention does not limit the second preset key word and the 3rd preset key word.
Step S3: call first template that prestores, utilize the registers group title to replace the registers group identifier in first template, obtain first code segment.
Store first template among the present invention in advance.The registers group title that in this first template, relates to replaces by the registers group identifier.
The code of first template is following:
Figure BDA0000156603250000051
In the present embodiment, D as the registers group identifier in first template, is not limited to this in the practical implementation process certainly.Among the step S3, the registers group identifier D that utilizes the registers group title that obtains among the step S2 to replace in first template gets final product.
Step S4: call the first template statement that prestores, utilize the registers group title to replace the registers group identifier in the first template statement, obtain first statement, first statement is inserted the primary importance place in the second current template, obtain second code segment.
Store the first template statement among the present invention in advance, the registers group title that relates in this statement all replaces with the registers group identifier.
The code of the first template statement is following:
`addr_D:rdata<=D;
In the present embodiment, D as the registers group identifier in the first template statement, is not limited to this in the practical implementation process certainly.The registers group identifier D that utilizes the registers group title that obtains among the step S2 to replace in the first template statement can obtain first statement.
Store second template among the present invention in advance, the code of this second template is following:
Figure BDA0000156603250000061
Wherein, the primary importance place in second template refers to and is positioned at key word " default " position before.First statement is inserted the primary importance place in second template, be about to first statement and insert key word " default " before, obtain second code segment.
Step S5: in the registers group file, obtain the command signal corresponding according to second preset rules, and confirm the type of each command signal with the registers group title.
Command signal in the registers group file comprises a read signal, a write signal and register signal.Generate in the process of registers group file the user, can add the various signals sign, distinguish the type of each command signal with this for dissimilar command signals.For example: can add different prefixs or suffix respectively for read-only signal, a write signal and register signal.In the enforcement, can add prefix w_ as signal identification,, and not add signal identification for register signal for a read signal adds prefix r_ as signal identification for a write signal.
At this moment, in the command signal definition statement of registers group file, be positioned at the character string of separating between the symbol " { " and symbol " } ", by symbol ", " and comprised command signal.In the command signal definition statement, extract the character string of separating by symbol ", ", judge afterwards whether each character string has added signal identification, after corresponding signal identification of deletion and bit wide, can obtain command signal.The type of each command signal is distinguished through its signal identification.
Step S6: utilize each command signal that the 4th current template is handled, obtain the 4th code segment.
The processing procedure that dissimilar command signals is corresponding different describes respectively below.
One, when command signal is write signal
Confirm the bit wide and the registers group bit wide of a write signal.
Generate in the process of registers group file the user, defined the bit wide of each command signal in the command signal definition statement, the character string that the rear side of each command signal finishes with symbol " [" beginning, with symbol "] " is the bit wide of each command signal; In the definition statement of the corresponding read-write of instruction position, defined the registers group bit wide, the bit wide of registers group is the character string that finishes with first symbol " [" beginning, with first symbol "] " in the definition statement of the corresponding read-write of instruction position.
Call the 3rd template that prestores; Utilize a write signal to replace signal identifiers in the 3rd template, utilize the registers group title to replace registers group identifier in the 3rd template, utilize the bit wide of a write signal to replace signal bit wide identifier in the 3rd template, utilize the registers group bit wide to replace the registers group bit wide identifier in the 3rd template, obtain third generation sign indicating number section.
Store the 3rd template among the present invention in advance, the code of the 3rd template is following:
In the 3rd template, E is a signal identifiers, and D is the registers group identifier, and G is a signal bit wide identifier, and F is a registers group bit wide identifier.Each identifier is replaced with aforementioned established data, can be obtained third generation sign indicating number section.
Third generation sign indicating number section is inserted the end of the 4th current template.
Store the 4th template among the present invention in advance, the code of the 4th template is following:
`include " define.v " // introducing define.v file
module?cmd_decoder();
input?clk,rst_n;
The character string of being made up of a write signal and corresponding bit wide thereof is added first prefix and second prefix respectively, generate two new command signals, these two new command signals are inserted the signal tabulation of current the 4th template.This first prefix is wr_w_ ", second prefix is " wdata_w_ ".
Two, when command signal is read signal
Confirm the bit wide of a read signal.
Call the second template statement that prestores, a utilization read signal is replaced the signal identifiers in the second template statement, the bit wide of a utilization read signal is replaced the signal bit wide identifier in the second template statement, obtains second statement.
The present invention stores the second template statement in advance, and concrete code is following:
inputG?r_A;
Wherein, A is a signal identifiers, and G is a signal bit wide identifier.Utilize a read signal replacement A, utilize the bit wide replacement G of a read signal, can obtain second statement.
Second statement is inserted the end of the 4th current template.
Character string to being made up of a read signal and bit wide thereof is added the 3rd prefix, generates new command signal, new command signal is inserted the signal tabulation of current the 4th template.The 3rd prefix is " r_ ".
Three, when command signal is register signal
Confirm the bit wide of register signal.
Call the 3rd template statement that prestores, utilize register signal to replace signal identifiers in the 3rd template statement, utilize the bit wide of register signal to replace the signal bit wide identifier of the 3rd template statement, obtain the 3rd statement.
The specific code of the 3rd template statement is:
regGA;
Wherein, A is a signal identifiers, and G is a signal bit wide identifier.Utilize register signal replacement A, utilize the bit wide replacement G of register signal, can obtain the 3rd statement.
The 3rd statement is inserted the end of the 4th current template.
To insert the signal tabulation of current the 4th template by the character string that registers group signal and bit wide thereof constitute.
Step S7: the end with first code segment and second code segment insert the 4th code segment successively forms the command decoder code.
When only comprising a registers group in the registers group file of user input, behind execution in step S1~S6, the end of directly first code segment and second code segment being inserted the 4th code segment successively gets final product.
When comprising a plurality of registers group in the registers group file of user's input, behind execution in step S6, judge whether that further whole registers group all generate respective code; When judged result shows when still having registers group not generate respective code; Repeated execution of steps S2~S6; Obtain first code segment, and upgrade second code segment and the 4th code segment, judge whether that afterwards whole registers group all generate respective code to this registers group; , judged result (formed N first code segment, second code segment and one the 4th code segment when showing that whole registers group all generate respective code; Wherein N is the quantity of the registers group that comprises in the registers group file); Execution in step S7; Concrete, as successively first code segment and second code segment of each registers group to be inserted the 4th code segment end forms the command decoder code.
Describe below in conjunction with specific embodiment.
Each registers group is 16bits, and command signal T_en, T_result [7:0] and T_offset [6:0] and temperature correlation are just formed a temperature register group.Wherein, T_en is an enable signal, is used to start the temperature analog to digital conversion one time, is the signal that outputs to analog to digital converter to command decoder, is a write signal, uses the w_ prefix designates; T_result [7:0] is the testing result of temperature analog to digital converter, is input signal concerning command decoder, and promptly a read signal is used the r_ prefix designates; T_offset is the shift value of user configured temperature analog to digital converter, is used for the systematic error of temperature sensor, is register signal to command decoder.The temperature register group is defined as address 1.Therefore the registers group file is:
`define bit_TEMP { w_T_en, r_T_result [7:0], T_offset [6:0] } // defined instruction signal
`define wr_TEMP/* wdata [15] * // * wdata [14:8] */, wdata [6:0] } // the corresponding read-write of defined instruction position
The process that generates the command decoder code comprises:
One, reads in registers group ff key word `define bit_; By the key word " `define bit_ " in the command signal definition statement in the registers group file " `define bit_TEMP{w_T_en; r_T_result [7:0], T_offset [6:0] } ", the name of learning this registers group is TEMP; D in first template is replaced with TEMP, obtains first code segment:
Figure BDA0000156603250000101
Two, with first template statement " `addr_D:rdata<=D; " in D replace with TEMP, obtain first statement, and first statement be inserted in primary importance place in second template, promptly be inserted into key word " default " before, obtain second code segment:
Figure BDA0000156603250000102
Three, in the command signal definition statement in the registers group file " `define bit_TEMP{w_T_en, r_T_result [7:0], T_offset [6:0] } ", be w_T_en for first character string that separator obtains to be separated with ", ".
This character string comprises prefix w_, representes that the command signal that this character string comprises is a write signal, this character string is removed prefix w_ obtain a write signal T_en, and the bit wide of a write signal T_en is empty.Afterwards, must write logical pulse, wire wr_w_T_en=wr&wr_addr==`addr_TEMP to a write signal T_en generation; Wire wdata_w_T_en=wdata [15], and with wr_w_T_en, wdata_w_T_en classifies the port signal of output as and sends into the signal tabulation, detailed process is following:
A) utilize a write signal T_en to replace the signal identifiers E in the 3rd template, utilize registers group title TEMP to replace the registers group identifier D in the 3rd template, because the bit wide of a write signal T_en is empty; So the signal bit wide identifier G in the 3rd template is empty; Afterwards, in the corresponding read-write of an instruction position definition statement " `define wr_TEMP{/* wdata [15], * // * wdata [14:8]; */wdata [6:0] } "; Confirm the character string that finishes with first symbol " [" beginning, with first symbol "] ", utilize this character string to replace the signal bit wide identifier F in the 3rd template, obtain third generation sign indicating number section.The end of afterwards, this third generation sign indicating number section being inserted current the 4th template.
Need to prove that the 4th current template is the 4th template that prestores.
B) a write signal T_en is added first prefix " wr_w_ " and second prefix " wdata_w_ " respectively; Generate two new command signal wr_w_T_en and wdata_w_T_en; Afterwards two new command signals are inserted the signal tabulation of current the 4th template, are about to two new command signals and insert the symbol ") in current the 4th template " preceding.
Need to prove b) the 4th current template that relates in the operation, no longer be the 4th template that prestores, but aforementioned the 4th new template that forms after the third generation sign indicating number section of having inserted.
Carrying out a) and b) after the operation, the code of current the 4th template is:
Certainly, in implementation process, also can carry out b earlier) a) operation of operation back execution.At this moment, carry out b) the 4th current template that relates to during operation is the 4th template that prestores, and the 4th current template that relates to when carrying out a) operation no longer is the 4th template that prestores, but carry out the 4th new template of the formation after inserting operation in the signal tabulation.In the implementation process, a) operation and b) execution sequence of operation can select arbitrarily, after carrying out two operations, all can obtain above-mentioned code segment.
Four, in the command signal definition statement in the registers group file " `define bit_TEMP{w_T_en, r_T_result [7:0], T_offset [6:0] } ", be r_T_result [7:0] for second character string that separator obtains to be separated with ", ".
This character string comprises prefix r, representes that the command signal that this character string comprises is a read signal, and this character string is removed prefix r and bit wide, and to obtain a read signal T_result, the bit wide of this read signal T_result is [7:0].
C) call second template statement " the inputG r_A; "; utilize a read signal T_result to replace the signal identifiers A in the second template statement; to utilize the bit wide [7:0] of a read signal T_result to replace the signal bit wide identifier G in the second template statement, promptly generate second statement " input [7:0] r_T_result; ".The end of afterwards, this second statement being inserted current the 4th template.
Need to prove that the 4th current template is to carry out aforementioned a) operation and b) back the 4th template that obtains of operation.
D) character string of being made up of a read signal T_result and bit wide thereof " T_result [7:0] " is added the 3rd prefix " r_ "; Generate new command signal " r_T_result [7:0] "; The command signal that this is new is inserted the signal tabulation, is about to " r_T_result [7:0] " and inserts the symbol ") in current the 4th template " preceding.
Need to prove that the 4th current template that d) relates in the operation is to carry out c) back the 4th template that obtains of operation.
Carrying out c) operation and d) after the operation, the code of current the 4th template is:
Figure BDA0000156603250000121
Figure BDA0000156603250000131
Certainly, in implementation process, also can carry out d earlier) operation back execution c) operation.
Five, in the command signal definition statement in the registers group file " `define bit_TEMP{w_T_en, r_T_result [7:0], T_offset [6:0] } ", be T_offset [6:0] for the 3rd character string that separator obtains to be separated with ", ".
This character string does not comprise prefix, representes that the command signal that this character string comprises is a register signal, and this character string is removed bit wide, and to obtain register signal T_offset, the bit wide of this register signal T_offset is [6:0].
E) call the 3rd template statement " regG A; "; utilize register signal T_offset to replace the signal identifiers A in the 3rd template statement; to utilize the bit wide [6:0] of register signal T_offset to replace the signal bit wide identifier G in the 3rd template statement, promptly generate the 3rd statement " reg [6:0] T_offset; ".Afterwards, the 3rd statement is inserted the end of current the 4th template.
Need to prove that the 4th current template is to carry out aforementioned a) operation, b) operation c) operation and d) the 4th template that obtains of operation back.
F) will insert the signal tabulation by the character string " T_offset [6:0] " that register signal T_offset and bit wide thereof are formed, and be about to " T_offset [6:0] " and insert the symbol ") in current the 4th template " preceding.
Need to prove that the 4th current template that f) relates in the operation is to carry out e) back the 4th template that obtains of operation.
Carrying out e) operation and f) after the operation, the code of current the 4th template is:
Figure BDA0000156603250000132
Figure BDA0000156603250000141
Certainly, in implementation process, also can carry out f earlier) operation back execution e) operation.Because the registers group that the user defines only comprises three command signals, therefore, be the 4th code segment when carrying out the 4th current template that obtains behind the aforesaid operations in the registers group file.
Six, first code segment and second code segment are inserted the end (being about to the end that first code segment inserts the 4th code segment, the end of again second code segment being inserted first code segment afterwards) of the 4th code segment respectively, generate the command decoder code.
In the above-mentioned disclosed code generating method of the present invention; Can generate the command decoder code automatically according to the registers group file of user's output; The user only need generate the registers group file that only is made up of two declarative statement; Compare with the manual output order decoder code of user, simplified user's operation, reduced user's workload, and then shortened the work period; In addition; Because the statement that the registers group file comprises is less; It is lower that the user generates the probability that makes a mistake in the registers group file process; And can not make a mistake because of the artificial origin according to the process that the registers group file generates the command decoder code automatically, therefore to compare with the mode of existing manual input instruction decoder code, code generating method disclosed by the invention can reduce the probability that code makes a mistake.
Each embodiment adopts the mode of going forward one by one to describe in this instructions, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.

Claims (3)

1. a code generating method is characterized in that, is used to generate the command decoder code, and said method comprises:
Step S1: the registers group file that receives user's input;
Step S2: in said registers group file, obtain the registers group title according to first preset rules;
Step S3: call first template that prestores, utilize said registers group title to replace the registers group identifier in said first template, obtain first code segment;
Step S4: call the first template statement that prestores; Utilize said registers group title to replace the registers group identifier in the said first template statement; Obtain first statement, said first statement is inserted the primary importance place in the second current template, obtain second code segment;
Step S5: in said registers group file, obtain and the corresponding command signal of said registers group title according to second preset rules, and confirm the type of each command signal;
Step S6: utilize said each command signal that the 4th current template is handled, obtain the 4th code segment, specifically comprise:
When said command signal is write signal, confirm the bit wide and the registers group bit wide of said write signal; Call the 3rd template that prestores; Utilize said write signal to replace signal identifiers in said the 3rd template, utilize said registers group title to replace registers group identifier in said the 3rd template, utilize the bit wide of said write signal to replace signal bit wide identifier in said the 3rd template, utilize said registers group bit wide to replace the registers group bit wide identifier in said the 3rd template, obtain third generation sign indicating number section; Said third generation sign indicating number section is inserted the end of the 4th current template; Character string to being made up of said write signal and bit wide thereof is added first prefix and second prefix respectively, generates two command signals, said two command signals is inserted the signal tabulation of said current the 4th template;
When said command signal is read signal, confirm the bit wide of said read signal; Call the second template statement that prestores, utilize said read signal to replace signal identifiers in the said second template statement, utilize the bit wide of said read signal to replace the signal bit wide identifier in the said second template statement, obtain second statement; Said second statement is inserted the end of the 4th current template; Character string to being made up of said read signal and bit wide thereof is added the 3rd prefix, generates new command signal, said new command signal is inserted the signal tabulation of current the 4th template;
When said command signal is register signal, confirm the bit wide of said register signal; Call the 3rd template statement that prestores, utilize said register signal to replace signal identifiers in said the 3rd template statement, utilize the bit wide of said register signal to replace the signal bit wide identifier of said the 3rd template statement, obtain the 3rd statement; Said the 3rd statement is inserted the end of the 4th current template; To insert the signal tabulation of current the 4th template by the character string that said register signal and bit wide thereof constitute;
Step S7: the end with said first code segment and second code segment insert said the 4th code segment successively forms the command decoder code.
2. method according to claim 1 is characterized in that, said command signal has the signal identification of distinguishing its type; Accordingly, confirm the type of each command signal according to the signal identification of said command signal.
3. method according to claim 2 is characterized in that, the signal identification of said read signal is prefix r, and the signal identification of said write signal is prefix w.
CN201210123079.8A 2012-04-24 2012-04-24 Code generation method Expired - Fee Related CN102662630B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210123079.8A CN102662630B (en) 2012-04-24 2012-04-24 Code generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210123079.8A CN102662630B (en) 2012-04-24 2012-04-24 Code generation method

Publications (2)

Publication Number Publication Date
CN102662630A true CN102662630A (en) 2012-09-12
CN102662630B CN102662630B (en) 2015-07-08

Family

ID=46772131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210123079.8A Expired - Fee Related CN102662630B (en) 2012-04-24 2012-04-24 Code generation method

Country Status (1)

Country Link
CN (1) CN102662630B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360861A (en) * 2014-11-19 2015-02-18 成都实景信息技术有限公司 Software code compiling system
CN107168864A (en) * 2016-03-08 2017-09-15 上海大唐移动通信设备有限公司 Code stream generation method and device
CN108829395A (en) * 2018-06-19 2018-11-16 中国电子科技集团公司第四十研究所 A kind of signal-oriented driver code automatic generation method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5835771A (en) * 1995-06-07 1998-11-10 Rogue Wave Software, Inc. Method and apparatus for generating inline code using template metaprograms
CN101114226A (en) * 2007-08-28 2008-01-30 北京中企开源信息技术有限公司 Code automatically generating device based on model component, system and method
CN101651683A (en) * 2009-08-28 2010-02-17 重庆重邮东电通信技术有限公司 Method for generating analysis source code of signaling message

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5835771A (en) * 1995-06-07 1998-11-10 Rogue Wave Software, Inc. Method and apparatus for generating inline code using template metaprograms
CN101114226A (en) * 2007-08-28 2008-01-30 北京中企开源信息技术有限公司 Code automatically generating device based on model component, system and method
CN101651683A (en) * 2009-08-28 2010-02-17 重庆重邮东电通信技术有限公司 Method for generating analysis source code of signaling message

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360861A (en) * 2014-11-19 2015-02-18 成都实景信息技术有限公司 Software code compiling system
CN107168864A (en) * 2016-03-08 2017-09-15 上海大唐移动通信设备有限公司 Code stream generation method and device
CN108829395A (en) * 2018-06-19 2018-11-16 中国电子科技集团公司第四十研究所 A kind of signal-oriented driver code automatic generation method and device

Also Published As

Publication number Publication date
CN102662630B (en) 2015-07-08

Similar Documents

Publication Publication Date Title
CN100454257C (en) Embedded system
US9063532B2 (en) Instruction insertion in state machine engines
CN100373388C (en) Method for fast generating logical circuit
CN106325919A (en) Configuration system and method based on PCIE (peripheral component interface express) Redriver
CN106294606B (en) A kind of CAE document conversion method and device based on general read-write frame
CN104007954B (en) Processor and the control method for processor
US10698697B2 (en) Adaptive routing to avoid non-repairable memory and logic defects on automata processor
CN102567413A (en) System and method for data filtering
CN101194228B (en) Performance microprocessor and device of fast return of microcontroller subroutine
CN103098039A (en) High-speed peripheral-device interconnected-bus port configuration method and apparatus
CN102662630A (en) Code generation method
CN110162764A (en) Method for splitting, device, equipment and the medium of electronic document
CN106776275B (en) A kind of testing process automatic generation method based on Packet Multiplexing
CN100549951C (en) PCB version recognition device and method
US20030070154A1 (en) Computer readable medium with definition of interface recorded thereon, verification method for feasibility to connect given circuit and method of generating signal pattern
CN106776775A (en) Concurrent master-slave synchronisation method and device
CN101667126A (en) Method for burning computer serial number
JP5265318B2 (en) Logic verification device
CN103902514A (en) Word format extracting and reutilizing method
JP2001117855A (en) Bus interface circuit generating device and recording medium
CN115185486B (en) Method, apparatus and storage medium for generating ASIC fabric declarations
CN113094071B (en) Micro control unit, control method thereof and firmware upgrading method thereof
CN111124548B (en) Rule analysis method and system based on YAML file
CN108806797A (en) A kind of processing method and system of medical data
US20150254386A1 (en) System and method for register transfer level autointegration using spread sheet and computer readable recording medium thereof

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
C56 Change in the name or address of the patentee
CP02 Change in the address of a patent holder

Address after: 510630 Guangdong city of Guangzhou province Panyu District Xiaoguwei Street West Outer Ring Road, room 629, 601-609 hall, Guangdong University of Technology, 100

Patentee after: Rising Micro Electronics Co., Ltd.

Address before: Five mountain Wushan Square C620-641 room 510630 Guangdong science and technology city of Guangzhou province Tianhe District

Patentee before: Rising Micro Electronics Co., Ltd.

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: 20150708

Termination date: 20210424