Embodiment
Fig. 2 forms a JTAG programming chain embodiment block diagram for logical device among the present invention.As shown in Figure 2, the JTAG chain of logical device 1-8 composition with difference and/or same type producer carries out online programming.The present invention mainly becomes a JTAG chain with each logical device of different and/or identical producer, and each logical device on the described JTAG chain is carried out online programming.
Behind JTAG chain of each logical device formation, can adopt four kinds of modes that each logical device is carried out online programming:
First kind of online programming mode generates respectively and comprises on the JTAG chain the single programming file of single logical device programming content on each logical device positional information, jtag instruction register length and the JTAG chain; Described each single programming file calls corresponding transplanting code respectively, and the respective logic device is carried out online programming;
Fig. 2 comprises 8 logical devices, and logic of propositions device 1 is the device of ALTERA company, and logical device 3 is the device of LATTICE; Then to generate the form of transplanting code JAMPLAYER identification be that the single programming file of .jbc (comprises each logical device positional information on the JTAG chain to the 1.pof of the logical device 1 correspondence programming file programming tool that need call ALTERA company, the programming content of logical device 1 on jtag instruction register length and the JTAG chain), in like manner, to generate the form of transplanting code ispVMEmdedded identification be that the single programming file of .vme (comprises each logical device positional information on the JTAG chain to the 3.jed of the logical device 3 correspondences programming file programming tool that need call LATTICE company, the programming content of logical device 3 on jtag instruction register length and the JTAG chain).This programming mode need generate eight of respective devices programming files, the transplanting code by calling different manufacturers the programming file load that comprises individual devices programming content that generates in the respective logic device.
Second kind of online programming mode, the different manufacturers programming tool generates the chaining programming file of several different-formats respectively on the JTAG chain; Described chaining programming file comprises on the JTAG chain identical producer logical device programming content on each logical device positional information, jtag instruction register length and the JTAG chain; Each chaining programming file calls corresponding transplanting code respectively, and each logical device on the JTAG chain is carried out online programming;
As shown in Figure 3, be second kind of online programming mode process flow diagram:
Step 1 ': the different manufacturers logical device utilizes producer's instrument to generate the chaining programming file of several different-formats respectively on the JTAG chain; Described chaining programming file comprises on the JTAG chain programming content and the positional information of identical producer logical device on each logical device positional information, jtag instruction register length and the JTAG chain;
Step 2 ': the chaining of different-format programming file calls corresponding transplanting code respectively, and the logical device of the correspondence on the JTAG chain is carried out online programming.
Now illustrate in conjunction with the process to second kind of online programming mode below Fig. 2:
In the JTAG chain as shown in Figure 2, logical device 1,3 is the device of ALTERA company, and logical device 2,4 is the device of LATTICE company; Below programming process is described:
A) generate the single programming file that comprises individual devices programming content respectively.Utilize the programming tool of ALTERA company to generate single programming file 1.pof, the 3.pof of corresponding form respectively as logical device 1 and 3; Logical device 2 and 4 utilizes the programming tool of LATTICE company to generate single programming file 2.jed, the 4.jed of corresponding form respectively;
B) generate the chaining programming file of the .jbc form comprise each logical device positional information on the JTAG chain, jtag instruction register length and logical device 1,3 programming contents, generate the chaining programming file of the .vme form that comprises each logical device positional information on the JTAG chain, jtag instruction register length and logical device 2,4 programming contents;
1.pof, generate to transplant the form of code JAMPLAYER identification be that the chaining programming file of .jbc (only comprises device 1 3.pof single programming file need call the programming tool of ALTERA company, each logical device position on 3 programming content and the JTAG chain, jtag instruction register length information), in like manner, logical device 2, the 2.jed of 4 correspondences, generate to transplant the form of code ispVMEmdedded identification be that the programming file of .vme (only comprises device 2 4.jed single programming file need call the programming tool of LATTICE company, each logical device positional information on 4 programming content and the JTAG chain, jtag instruction register length information);
C) chaining of various forms programming file calls corresponding transplanting code respectively, and the logical device on the JTAG chain is carried out online programming:
The chaining programming file of .jbc form that only comprises the programming content information of each logical device positional information on the JTAG chain, jtag instruction register length and device 1,3 calls corresponding transplanting code JAMPLAYER logical device 1,3 is carried out online programming; The chaining programming file of .vme form that only comprises the programming content of each logical device positional information on the JTAG chain, jtag instruction register length and device 2,4 calls corresponding transplanting code ispVMEmdedded logical device 2,4 is carried out online programming.
As from the foregoing, article one, several different producers are arranged on the JTAG chain, need several of generations to comprise the chaining programming files of identical producer logical device programming content, the chaining that generates is programmed file load in the counterlogic device by the transplanting code that calls different manufacturers.
The third online programming mode, the different manufacturers logical device utilizes producer's instrument to generate the chaining programming file of several different-formats respectively on the JTAG chain; Described chaining programming file comprises on the JTAG chain programming content of identical producer logical device on each logical device positional information, jtag instruction register length and the JTAG chain; Chaining programming file to the different-format that generates is resolved, and obtains the programming content of each logical device on the JTAG chain, and each logical device on the JTAG chain is carried out online programming;
As shown in Figure 4, be the third online programming mode process flow diagram:
Step 1 ": utilize different manufacturers programming tool on the JTAG chain to generate the chaining programming file of several different-formats respectively;
Step 2 ": the chaining programming file to the different-format that generates is resolved, and obtains the programming content of respective logic device, and the respective logic device on the JTAG chain is carried out online programming.
Utilize the programming tool of different manufacturers on the JTAG chain generate respectively several different-formats chaining programming file concrete generative process can referring in second kind of online programming mode a) and b) description of part.
Below the chaining programming file of the different-format that generates is resolved, the programming content of obtaining the respective logic device describes, and referring to Fig. 5, the programming content of chaining programming document analysis being obtained the respective logic device comprises:
Step 21:, carry out cyclic redundancy (CRC) verification of corresponding form according to the form of chaining programming file; As: the chaining programming file layout of input is .jbc, then carries out jbc form corresponding check, jbc_crc_check;
Step 22: judge whether cyclic redundancy check (CRC) is correct, when cyclic redundancy check (CRC) is correct, execution in step 23; Otherwise finish;
Step 23:, resolve the programming content of positional information, jtag instruction register length information and the respective logic device of each logical device on the JTAG chain according to the form of chaining programming file.
After generating described chaining programming file, the resolving of different-format is set according to the form (forms such as .jbc .vme) of each chaining programming file, parse logical device information, instruction length and programming content etc. on the concrete JTAG chain, finish loading and programming logical device on the JTAG chain.
Concrete: after obtaining chaining programming file,, carry out the parsing of corresponding form as .jbc form, vme form according to the form of chaining programming file.The chaining programming file of every kind of form can store fixing information in the fixed position, and table 1 is depicted as the chaining programming file layout of .jbc form:
The chaining programming file format table of table 1 .jbc form
Last table has just carried out some simple analysis to the form of .jbc file, and the left side one row target is the address.First_word (4A414D01) fixes, and also might be 4A414D00, in the first address of chaining programming file if these two values then can parse the chaining programming file into the .jbc form, and be to be generated by the QUARTUS programming tool.Ensuing action_table, procdure_table, storages such as string_table be the address of variable, these variablees all are meant the aciculiform formula, retrieve the corresponding value of information according to the address of pointer indication from the relevant position of chaining programming file.Therefore the chaining of .jbc form programming file is to form according to a kind of arrangement architecture of this pointer basically, in all useful informations are included in entirely.After correspondence position reads corresponding information, can obtain the positional information of each logical device on the form, version information, compilation tool, JTAG chain of file, the data programmed content of respective logic device etc. according to the chaining of this form programming file.
In the present embodiment step 22, if chaining programming file layout is the .jbc form, cyclic redundancy data Crc_section in jbc_crc_check check results of carrying out and the chaining programming file compares, deposit the position cyclic redundancy data Crc_section as 0x28-0x2b in the table 1, for follow-up parsing and online programming provide the accuracy assurance.Other as.Though the implication of data is different in the deposit position of the chaining of forms such as vme programming file and the chaining programming file data of .jbc form and each position, just deposits the form difference, resolving is similar, exemplifies no longer one by one at this.
Behind programming Context resolution to different-format chaining programming file, obtain the programming content of positional information, jtag instruction length and each logical device of each logical device, then each logical device is carried out online programming, back extended meeting is specifically described the programme process of load content of logical device.
The 4th kind of online programming mode generates a chaining programming file that comprises the serial vector format of all logical device information on the JTAG chain, utilizes described chaining programming file that arbitrary logical device on the JTAG chain is carried out online programming.
Below in conjunction with Fig. 2 and Fig. 6 the method for the 4th kind of online programming of logical device is described.
Fig. 6 is method embodiment three process flow diagrams of logic device on-line programming of the present invention.As shown in Figure 6, present embodiment comprises:
Step 1: the chaining programming file that generates a serial vector format that comprises each logical device positional information on the JTAG chain, jtag instruction register length, each logical device programming content;
Step 2: described chaining programming file is resolved, obtain the programming content of each logical device, each logical device on the JTAG chain is carried out online programming.
Present embodiment step 1 need to generate a chaining programming file, and all logical devices programming content, jtag instruction register length and the positional informations etc. of similar and different producer on the JTAG chain are included.Step 1 generates the process of a chaining programming file that meets the demands referring to Fig. 7, comprising:
Step 11: generate the programming file comprise the single serial vector format of single logical device programming content and jtag instruction register length on the JTAG chain;
Step 12:, generate or each single programming file edit is generated the chaining programming file of a serial vector format with arbitrary programming tool according to the position of each logical device on the programming file of above-mentioned single serial vector format and the JTAG chain.
Below in conjunction with Fig. 2 the generative process of serial vector format chaining programming file is illustrated: for example, 1,3 is the device of ALTERA company among Fig. 2, and 2,4 is the device of LATTICE company; Generating a chaining programming file that comprises the serial vector format of logical device 1-4 comprises:
A) generate the single programming file that comprises individual devices programming content and jtag instruction register length respectively.Utilize the programming tool of ALTERA company to generate single programming file 1.pof, the 3.pof of corresponding form respectively as logical device 1 and 3; Logical device 2 and 4 utilizes the programming tool of LATTICE company to generate single programming file 2.jed, the 4.jed of corresponding form respectively;
B) the single programming file of each logical device different-format on the JTAG chain to be generated a chaining programming file, need earlier the single programming file of different-format to be generated the programming file of serial vector format, as: utilize the programming tool of LATTICE company 2.jed and 4.jed to be converted to programming file 2.svf, the 4.svf of serial vector format (Serial Vector Format is abbreviated as svf).The serial vector format is the file layout that different programming tools can generate, and all logical devices are all supported the programming file of this form;
C) use arbitrary programming tool, as: the programming tool ispVM of LATTICE company, the single programming file of 4 serial vector formats is generated a chaining programming file that comprises device 1-4 serial vector format, perhaps each single programming file edit is generated a chaining programming file that comprises device 1-4 serial vector format:
Utilize the chain editting function of programming tool, position priority according to logical device, the single programming file of 4 single serial vector formats is generated the chaining programming file of a serial vector format, perhaps, each single serial vector format programming file edit is merged the chaining programming file that generates a serial vector format according to the location order of each logical device on the JTAG chain.
Therefore, utilize arbitrary programming tool or edit can generate the chaining programming file of a serial vector format, comprise the position of each logical device on the JTAG chain in this chaining programming file, programming content and jtag instruction register length.After generating the chaining programming file of a serial vector format, described chaining programming file is resolved, obtain the programming content of each logical device, then arbitrary logical device on the JTAG chain is carried out online programming.
The serial vector format has defined a cover grammer, in order to the scanning sequency and the process of description jtag instruction and data, and the content of instruction and data, be the descriptive language of JTAG channel link action.It is different with the chaining programming file of .jbc or .vme form that (the chaining programming file as the .jbc form that table one exemplified is the binary code that is difficult to distinguish, be difficult for recognition), it is equally readable than higher that the files classes of serial vector format are similar to the C language file, the content of the chaining programming file of this form is readable, even can edit as required, therefrom can directly parse programming instruction, data content and the positional information etc. of each logical device, obtain again each logical device to be loaded corresponding programming content after each logical device information.
First kind and second kind of online programming mode need generate several single programming files or chaining programming file; And call corresponding transplanting code respectively, and each logical device on the JTAG chain is carried out online programming, these two kinds of programming modes and programming process are fairly simple, but are subjected to the restriction that code is transplanted by each producer; The third online programming mode also needs to generate the chaining programming file of several different-formats, transplants code but never call producer during later programmed, and the chaining programming file of the different-format that generates is resolved, and has removed producer to transplanting the privately owned protection of code; The 4th kind of online programming mode realized the online programming to logical device on the JTAG chain equally, generate the chaining programming file of a serial vector format, and, can finish loading and programming to all logical devices with the chaining file of programming to the chaining of described serial vector format programming document analysis.
In the third and the 4th kind of online programming mode, after chaining programming document analysis obtained programming content, instruction length and the positional information of each logical device, can carry out online programming to each logical device on the JTAG chain, referring to Fig. 8, each logical device on the JTAG chain is carried out online programming comprises:
Step 31: according to each logical device positional information, jtag instruction register length instruction is handled, with the selected programming state of the logical device of needs programming;
Step 32: data content is added the logical device that needs programming.
According to each logical device positional information, jtag instruction register length the logical device of needs programming is sent programming instruction in the step 31, the logical device that does not need to programme is sent bypass instruction, to the instruction of each logical device be sent successively according to the position, then only to the selected programming state of the logical device of needs programming.
Fig. 9 resolves synoptic diagram for Fig. 8 embodiment.As shown in Figure 9, three devices become a JTAG chain, from test data input (Test Data Input is called for short TDI) mouthful input data, from test data output (Test Data Out put is called for short TDO) mouthful output data.Device 2 is programmed, suppose knowing that the jtag instruction register length of device 1 is 6 behind the chaining programming document analysis; The jtag instruction register length of device 3 is 8; The jtag instruction register length of device 2 is 10, and the binary command of online programming (ISC_PROGRAM) is " 0000010010 ".To device 2 programmings the time, need give the order register of device 2 online programming (ISC_PROGRAM) instruction, device 1 and 3 all needs bypass (according to the IEEE1149.1 standard, bypass instruction is " 1 " entirely), therefore in the scan instruction cycle, the binary command of sending into from TDI should be " 111111000001001011111111 ", totally 24.The instruction that device 1 receives is exactly " 111111 ", and the instruction that device 2 receives is exactly " 0000010010 ", and the instruction that device 3 receives is exactly " 11111111 ".Device 1 and 3 is carried out bypass operation, and device 2 begins to carry out the online programming operation, and the programming data content is given device 2 from TDI, and device 1 and 3 is in bypass condition.
In like manner, the programming content being added the logical device process that needs to programme is: the logical device that does not need to programme is sent bypass data (according to IEEE 1149.1 and IEEE 1532 standards, bypass data send " 0 " to get final product).To the logical device of needs programming, the data content of this logical device moves into device serially by the TDI mouth of jtag interface, obtains the programming content.Programming data as device 2 is 97 " * * * * ... .** ", totally 97 bit data, when then device 2 being write the programming content, need give the data register of device 2 the programming content, device 1 and 3 all needs bypass (only need send " 0 " gets final product), and therefore the binary data of sending into from TDI should be " 0****....**0 ", totally 99, device 1 and device 3 are bypass datas, have only device 2 to receive 97 programming data.Concrete operations in the IEEE1149.1 standard criterion, have been stipulated the operation of serial-shift and bypass with reference to IEEE1149.1 and IEEE 1532 standards, are not described in detail in this.
Figure 10 carries out embodiment two process flow diagrams of online programming to a logical device on the JTAG chain for the present invention.Comprise the chaining programming file of several different-formats that the chaining programming file of a serial vector format of each logical device positional information on the JTAG chain, jtag instruction register length, each logical device programming content or generation comprise each logical device positional information on the JTAG chain, jtag instruction register length and identical producer logical device programming content in generation after, by parsing to chaining programming file, after obtaining the position, programming data, instruction length of each logical device on the JTAG chain, when a certain logical device is programmed on to the JTAG chain, comprising:
Step 310: call the JTAG control function, make whole JTAG chain be in programming state;
Step 311: programming instruction is handled, and non-programming device substitutes with bypass instruction;
Step 312: the instruction after output is additional, the selected logical device that needs programming;
Step 32: the output programming data, programme;
Step 4: the programming data that the logical device serial-shift is read carries out verification, judges whether to be then to finish correctly, otherwise judge whether to surpass default number of times, present embodiment is set at 3 times, if be no more than 3 times then execution in step 310, reprogramming, otherwise finish the expression program fail.
After a certain logical device was carried out online programming, the programming data that the logical device serial-shift is read carried out verification, judge the data programmed content whether with want the loaded data content consistent, guarantee accuracy to logic device on-line loaded.
Figure 11 is device embodiment one synoptic diagram of logic device on-line programming of the present invention.As shown in figure 10, present embodiment comprises:
Acquisition module 1, be connected with programming module 2, be used to obtain the chaining programming file of the different-format that comprises each logical device positional information on the JTAG chain, jtag instruction register length and identical producer logical device programming content or comprise the chaining programming file of the serial vector format of all logical device positional informations on the JTAG chain, jtag instruction register length, logical device programming content;
Programming module 2 is connected with acquisition module 1, is used to resolve chaining programming file, obtains the programming content of each logical device and arbitrary logical device on the JTAG chain is carried out online programming.
Figure 11 embodiment is for realizing the device of logic device on-line programmed method among the present invention, can be implemented on the JTAG chain, with chaining programming file the logical device of different manufacturers on the JTAG chain is carried out online programming, strengthened the logical device flexibility of programming, occupy less physical resource, reduce the cost and the programming complexity of document management.
Figure 12 is a programming module inner structure embodiment synoptic diagram of the present invention.As shown in figure 12, in the present embodiment, programming module comprises:
Interface module 21 is connected with parsing module 22, reads in chaining programming file, and the jtag interface of steering logic device is finished programming operation; Described interface module 21 is connected with the jtag interface of programming device, with output and control programming data content;
Parsing module 22 is connected with interface module 21, according to the programming content of each logical device of chaining programming document analysis that obtains; And import analysis result into interface module 21 when a certain logical device carried out online programming; Parsing module 22 further comprises:
Syndrome module 221 is connected with form analyzing sub-module 222, and chaining programming file is carried out verification, by the time import the chaining file of programming into format analysis submodule 222;
Format analysis submodule 222, be connected with syndrome module 221 and sub module stored 223, form according to chaining programming file, chaining programming file is resolved, obtain positional information, jtag instruction register length information and each logical device data programmed content of each logical device on the JTAG chain;
Sub module stored 223 is connected with form analyzing sub-module 222, preserves each logical device data programmed content of resolving.
The verification submodule can carry out verification to the chaining file of programming in the present embodiment, has increased accuracy; The format analysis module can be carried out corresponding parsing according to the chaining different form of file of programming, and concrete operations can be referring to the explanation of the inventive method embodiment.
Among Figure 12 embodiment, described programming module can also comprise: calling module 23, be connected with interface module 21, the chaining programming file that is used for the different-format that comprises each logical device positional information on the JTAG chain, jtag instruction register length and identical producer logical device programming content that obtains according to interface module calls corresponding transplanting code, and the content of will programming is imported interface module 21 into.
After the satisfied chaining that only comprises identical producer logical device programming content of generation is programmed file, the transplanting code that can call producer carries out online programming to logical device on the chain, perhaps the chaining programming file of different-format is resolved, then logical device on the chain is carried out online programming, so programming module can comprise parsing module or calling module, also can both include, realize programming mode flexibly.
Figure 13 is device embodiment two synoptic diagram of logic device on-line programming of the present invention.Parsing module inner structure and Figure 12 are similar among Figure 13, difference is, also comprise in the parsing module: data processing submodule 224, be connected with sub module stored 223, according to each logical device positional information, jtag instruction register length programming instruction or data are handled, instruction or data after handling are sent to interface module 21.Other with Figure 12 in identical specific functional modules no longer describe in detail.
The embodiment of the invention forms a JTAG chain for the logical device of different manufacturers, does not need to transplant the programming code that different manufacturers provides, and can carry out online programming to the logical device on the JTAG chain, has strengthened the logical device flexibility of programming; Can generate a chaining programming file that comprises the serial vector format of all logical device information, utilize a chaining programming file that logical device is programmed, reduced document management cost, occupy less physical resource, and when having simplified a plurality of logical device chaining of different manufacturers greatly logical device is carried out the complexity of online programming, be specially adapted to embedded programming, carry out remote upgrade and maintenance.
It should be noted that at last: above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.