CN1138203C - Method for implementing print on DSP - Google Patents

Method for implementing print on DSP Download PDF

Info

Publication number
CN1138203C
CN1138203C CNB001279688A CN00127968A CN1138203C CN 1138203 C CN1138203 C CN 1138203C CN B001279688 A CNB001279688 A CN B001279688A CN 00127968 A CN00127968 A CN 00127968A CN 1138203 C CN1138203 C CN 1138203C
Authority
CN
China
Prior art keywords
digital signal
signal processor
serial port
parameter
printing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB001279688A
Other languages
Chinese (zh)
Other versions
CN1360250A (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.)
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 CNB001279688A priority Critical patent/CN1138203C/en
Publication of CN1360250A publication Critical patent/CN1360250A/en
Application granted granted Critical
Publication of CN1138203C publication Critical patent/CN1138203C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

The present invention discloses a method for realizing print on a digital signal processor. The method transmits data formatted messages to a host machine through a chip of a serial port, and a formatting process is executed by the host machine; when the data messages are formatted, fixed bytes are used for fitting the magnitude of the buffer of the serial port, and one message can be written once; finally, in print, the data messages to be printed are directly put in a buffer of the host machine, and the background of the host machine carries out formatted display print. The present invention has the advantages of flexible printing mechanism, intuitional debug information show and little influence on the formatting and outputting performance of the parameters.

Description

A kind of Method of printing that is implemented on the digital signal processor
Invention field
The present invention relates to mobile communication technology, be meant that more specifically one is implemented in the Method of printing on the digital signal processor.
Background technology
In mobile communication, the experimental data printing is generally carried out on digital signal processor, as TMS320C6x is a kind of digital signal processor series of TI company, it adopts advanced CLIW structure, improve performance by improving walking abreast of instruction-level, the peak value processing power reaches 1600MIPS, digital signal processor is used and can be realized by the C language, in the C language, the most basic printf is famous printf, and the function that it is finished comprises the format of air exercise seal parameter and format result's actual output.
Because digital signal processor is applied to the occasion that high speed signal is handled, real-time and handling property there is higher requirement, the design of (being mainly used in the occasion that needs the high speed processing computing as TMS320C6x digital signal processor series) processor lays particular emphasis on handling up of data and arithmetic speed, support to man-machine interaction is not enough, do not have the serial equipment on the ordinary meaning, debugged program is undertaken by emulator.
The general employing of the scheme that Debugging message on existing several solution digital signal processor is printed is following several:
(1) the C standard library function printf that uses manufacturer to provide
Implementation: at first the information of desire being printed by the formatted message of first parameter formats processing, forms the final objective character string, by emulator target string is passed to main frame again, is shown by the artificial debugging software on the main frame.
Advantage: the printf function is the realization fully of standard library function, and format mechanism can be printed a plurality of parameters and polytype data flexibly.
Shortcoming: the time of printing a piece of news is oversize, print a character and just need more than 1000 instruction cycle, along with the increase of number of characters and the format of integer type, floating point type etc., the time of printing a piece of news will be doubled and redoubled, thing followed problem is that the time of printing a piece of news is uncertain, and this is insupportable concerning the real-time application that needs high speed processing, and under the situation that does not connect emulator, this method also is infeasible.
(2) external serial port chip, redirected printf outputs to serial port chip
Also can print Debugging message in order to solve under the environment that does not connect emulator, the special-purpose serial port chip of external memory interface connection by processor is connected with the serial ports of main frame again.The format of message part is the same with printf function in (1) in the implementation, is not by emulator during actual output, but exports by serial port chip, is received by the serial port terminal of main frame at last and shows Debugging message.This kind method is outside having the advantage that does not rely on the emulator, and other relative merits are identical with the scheme of (1).
(3) external serial port chip, directly the output message string is to serial port chip
Connection on the hardware is the same with the method for (2), because the formatting procedure of parameter needs the more instruction cycle, by cancelling formative process, improve the efficient of execution, when needs are printed, directly get fixing character string and write serial port chip, receive and show Debugging message by the serial port terminal of main frame.
Advantage: owing to there is not formative process, so efficient greatly improves, the time of printing mainly is exactly the time that character string is write serial port chip, and is less to Effect on Performance, can satisfy real-time demands of applications.
Shortcoming: owing to cancelled the formatting procedure of parameter, so printing control is dumb, can only print fixing string, can not print integer, floating number etc., this debugging to C programmer is very unfavorable.The difference of message string length, the time-write interval is also different, and particularly the transmission of serial ports is relatively slow, when the buffer zone of the longer serial port chip of message string is expired, must wait for the transmission of serial ports, influences the efficient of processor.
Summary of the invention
For this reason, the objective of the invention is at the weak point that has the method existence that on digital processing unit, prints now, a kind of Method of printing that is implemented on the digital signal processor is provided, it is not being connect under the situation that maybe cannot connect emulator, calling interface can provide the mechanism of printing flexibly, can show Debugging message intuitively again, simultaneously processor not had big infringement in the format of parameter and the performance and the efficient of output.
To achieve these goals, the present invention adopts following technical scheme: this is implemented in the Method of printing on the digital signal processor, this method is based on main frame and target machine, the serial port chip of target machine is connected on the external memory interface of digital signal processor, digital signal processor program is by the register of external memory interface operation serial port chip, by string line serial port chip is connected with a serial ports in the main frame, it is characterized in that: the data message that will have certain transformat earlier sends on the main frame by serial port chip, and carries out formative process by main frame; When data message is carried out transmission formatting, adopt fixed byte to be fit to the size of serial ports buffering, make a piece of news energy write-once; At last when printing, the data message that print is directly put into the impact damper of main frame, format by the main frame backstage and show printing.
Because the present invention adopts data formatting information is sent on the main frame by serial port chip, and carry out formatting procedure by main frame; When data message is carried out form, adopt fixed byte to be fit to the size of serial ports buffering, make a piece of news energy write-once; At last when printing, the data message that print is directly put into the impact damper of main frame, format by the main frame backstage and show printing.The shortcoming that three kinds of methods utilizing Method of printing of the present invention to overcome in background effectively to be described exist, under the situation that does not connect emulator, the application scenario of having considered digital signal processor is to readability and the dirigibility of efficient performance requirement than Ke quarter and C Programming with Pascal Language; Calling interface can provide the mechanism of printing flexibly, can show Debugging message intuitively again, drops to minimum to digital signal processor in the format of parameter and the performance impact of output simultaneously.
Description of drawings
Below in conjunction with drawings and Examples, method of the present invention is done one explains:
Fig. 1 be method of the present invention based on the hardware configuration synoptic diagram.
Embodiment
Please in conjunction with Fig. 1 Method of printing of the present invention based on main frame 1 and the target machine 2, the serial port chip of target machine 2 is connected on the external memory interface of digital signal processor, digital signal processor (as the processor of TMS320C6x series) just places on the target machine 2, digital signal processor program is by the register of external memory interface access serial port chip, by a string line 3 serial port chip is connected with a serial ports in the main frame, method of the present invention is earlier data formatting information to be sent on the main frame by serial port chip, and carries out formatting procedure by main frame; When data message is carried out form, adopt fixed byte to be fit to the size of serial ports buffering, make a piece of news energy write-once; At last when printing, the data message that print is directly put into the impact damper of main frame, format by the main frame backstage and show printing.
Data message on the digital signal processor is being sent in the serial port chip process, detecting the state of serial port chip earlier,, just do not sending, sending, sending the mode that adopts buffering otherwise get a data message one-time write serial ports if be not empty entirely.
Data message is formatted as sequence number, format address, parameter 1,2 four territories of parameter.Described sequence number is used for determining whether the process of transmitting data message is lost, and the value of sequence number adds one when every data generate; Format address is the address of first format parameter of printf function; Parameter 1 and parameter 2 are 32 maximum 2 parameters, can have 0,1 or 2, and when not having, its value replaces with 0, and parameter can only be got two at most.
On the TMS320C6x digital signal processor, to realize printing to example, the serial port chip of target machine 2 is connected on the external memory interface of processor C6x, processor program is connected serial port chip by a string line 3 by the register of external memory interface access serial port chip with a serial ports of main frame 1.
Target machine 2 sides:
Serial ports adopts the chip with 16 bytes bufferings, once can write 16 bytes simultaneously, can the write-once serial port chip in order to make a piece of news, and do not wait for the transmission of serial ports, must satisfy two conditions:
A) before a piece of news sent, the serial ports buffer zone was empty
B) length of a piece of news<=16
In order to satisfy first condition, message sends the mode that must adopt buffering, the message core buffer that writes direct, by the background printing task when task is idle, and serial ports buffer zone one-time write serial ports when be sky,
In order to satisfy second condition, we adopt a piece of news to be fixed as 16 byte longs, and particular content is
32 32 32 32
Sequence number Format address Parameter 1 Parameter 2
Sequence number is used for determining to have or not message to abandon, and adds one when every message generates, and format address is the address of first parameter of printf function, comprise format parameter, parameter 1 and parameter 2 are 32 maximum 2 parameters, can have 0,1 or 2, when not having, value replaces with 0.
Call example:
0 parameter supposes that the address of " No extra parameter n " is 0 * 80001000, then printF (" No extra parameter n "); Actual being output as
1 ?0×80001000 0 0
1 parameter supposes that the address of " One parameter is%d n " is 0 * 80002000, and value1 is 100, then
Print (" One parameter is%d n ", value1); Actual being output as
2 ?0×80002000 100 0
2 parameters suppose that the address of " Two parameters are%d and%d n " is 0 * 80003000, and value1 is 100, and value2 is 200, then
printf(″Two?parameters?are%d?and%d\n″,value1,value2);
Actual being output as
3 ?0×80003000 100 200
The execution of a printf function is just copied the value of parameter in the buffer zone, needs 24 instruction cycles just can finish altogether, actual output by background process at one's leisure an a piece of news write serial ports.
Main frame 1 side:
Bigger buffer zone of the software maintenance of host computer side, the message one by one of coming the receiving target machine, and the cancellation breath shows from buffer zone, owing to pass to the message of main frame is not actual result, main frame must resolve and format message, and the destination file format of processor C6x is the general target file layout, and the inside has comprised the address information and the data message of various symbols, by searching general target file layout file, just can get corresponding information.
1 ?0×80001000 100 0
Obtain character string " No extra parameter n " by the data of searching 0 * 80001000 address, obtain the result by resolving this character string again, and print result be as follows:
1.No?extra?parameter
After using Method of printing of the present invention, printing the used time of a piece of news is to add the time of 16 bytes to serial ports of writing 24 instruction cycles, so to almost not influence of performance.Realized the formatted print flexibly of similar printf function on function, can not influence performance on efficient, and no matter message is length, the time is determined.

Claims (4)

1, a kind of Method of printing that is implemented on the digital signal processor, this method is based on main frame and target machine, the serial port chip of target machine is connected on the external memory interface of digital signal processor, digital signal processor program is by the register of external memory interface operation serial port chip, by string line serial port chip is connected with a serial ports in the main frame, it is characterized in that: the data message that will have certain transformat earlier sends on the main frame by serial port chip, and carries out formative process by main frame; When data message is carried out transmission formatting, adopt fixed byte to be fit to the size of serial ports buffering, make a piece of news energy write-once; At last when printing, the data message that print is directly put into the impact damper of main frame, format by the main frame backstage and show printing.
2, the Method of printing that is implemented on the digital signal processor as claimed in claim 1, it is characterized in that: the data message on the digital signal processor is being sent in the serial port chip process, detect the state of serial port chip earlier, if be not empty entirely, just do not send, send otherwise get a data message one-time write serial ports, send the mode that adopts buffering.
3, the Method of printing that is implemented on the digital signal processor as claimed in claim 1 is characterized in that: described format is that data message is formatted as sequence number, format address, parameter 1,2 four territories of parameter.
4, the Method of printing that is implemented on the digital signal processor as claimed in claim 3 is characterized in that: described sequence number is used for determining whether the process of transmitting data message is lost, and the value of sequence number adds one when every data generate; Format address is the address of first format parameter of printf function; Parameter 1 and parameter 2 are 32 maximum 2 parameters, can have 0,1 or 2, and when not having, its value replaces with 0, and parameter can only be got two at most.
CNB001279688A 2000-12-21 2000-12-21 Method for implementing print on DSP Expired - Fee Related CN1138203C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB001279688A CN1138203C (en) 2000-12-21 2000-12-21 Method for implementing print on DSP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB001279688A CN1138203C (en) 2000-12-21 2000-12-21 Method for implementing print on DSP

Publications (2)

Publication Number Publication Date
CN1360250A CN1360250A (en) 2002-07-24
CN1138203C true CN1138203C (en) 2004-02-11

Family

ID=4592877

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB001279688A Expired - Fee Related CN1138203C (en) 2000-12-21 2000-12-21 Method for implementing print on DSP

Country Status (1)

Country Link
CN (1) CN1138203C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100871852B1 (en) * 2005-12-29 2008-12-03 삼성전자주식회사 Method and apparatus for image forming

Also Published As

Publication number Publication date
CN1360250A (en) 2002-07-24

Similar Documents

Publication Publication Date Title
US6163764A (en) Emulation of an instruction set on an instruction set architecture transition
US7434030B2 (en) Processor system having accelerator of Java-type of programming language
US6098112A (en) Streams function registering
US5428786A (en) Branch resolution via backward symbolic execution
US5507030A (en) Successive translation, execution and interpretation of computer program having code at unknown locations due to execution transfer instructions having computed destination addresses
US6484255B1 (en) Selective writing of data elements from packed data based upon a mask using predication
JPH05216917A (en) Arithmetic and logic unit
EP0992894A1 (en) Apparatus and method for loop execution
US6898700B2 (en) Efficient saving and restoring state in task switching
US20040088524A1 (en) Inter-processor control
CN1138203C (en) Method for implementing print on DSP
CN1508674A (en) Method for providing width-variable at least six-path addition instruction and apparatus thereof
US6742110B2 (en) Preventing the execution of a set of instructions in parallel based on an indication that the instructions were erroneously pre-coded for parallel execution
US5732235A (en) Method and system for minimizing the number of cycles required to execute semantic routines
US7296187B1 (en) Hardware debug device having script-based host interface
US6681319B1 (en) Dual access instruction and compound memory access instruction with compatible address fields
US8583897B2 (en) Register file with circuitry for setting register entries to a predetermined value
CN1503153A (en) Asynchronous communication protocol using efficient data transfer formats
US5860155A (en) Instruction decoding mechanism for reducing execution time by earlier detection and replacement of indirect addresses with direct addresses
EP0992889A1 (en) Interrupt processing during iterative instruction execution
EP0415351A2 (en) Data processor for processing instruction after conditional branch instruction at high speed
EP0992892B1 (en) Compound memory access instructions
CN1541356A (en) FIFO write/FIFO read trace buffer with software/hardware loop compression
WO2021061260A1 (en) System, device, and method for obtaining instructions from a variable-length instruction set
JPH01120638A (en) Information processor

Legal Events

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

Granted publication date: 20040211

Termination date: 20161221

CF01 Termination of patent right due to non-payment of annual fee