CN101493808B - Serial using method and multi-core processor - Google Patents
Serial using method and multi-core processor Download PDFInfo
- Publication number
- CN101493808B CN101493808B CN2009101199882A CN200910119988A CN101493808B CN 101493808 B CN101493808 B CN 101493808B CN 2009101199882 A CN2009101199882 A CN 2009101199882A CN 200910119988 A CN200910119988 A CN 200910119988A CN 101493808 B CN101493808 B CN 101493808B
- Authority
- CN
- China
- Prior art keywords
- nuclear
- main
- debugging message
- serial port
- serial ports
- 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.)
- Active
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a usage method of a serial port, and a multi-core processor, relating to the communication field. By a main core, debugging information sent from at least one core is received and the received debugging information is output by the debugging serial port. The invention solves the problem that a core which needs to output debugging information takes up too much processor resource in order to detect the state of the serial port. The invention is suitable for the debugging of the multi-core processor.
Description
Technical field
The present invention relates to the communications field, relate in particular to a kind of using method and polycaryon processor of serial ports.
Background technology
Polycaryon processor has become the developing direction of processor.In polycaryon processor, can examine the deployment operation system at each, these operating systems all need to debug by debug serial port.And veneer often only provides a debug serial port for debugging usefulness, and therefore, the operating system that each nuclear is gone up operation need be shared and use this debug serial port.
At present, the scheme of each internuclear shared debug serial port is: when utilizing debug serial port output Debugging message, usually adopt spin-lock (spin lock) mutual exclusion to add polling mode output Debugging message, when even certain nuclear need be exported Debugging message by debug serial port, detect spin-lock or com-state position, judge whether this debug serial port is taken by other nuclear locking.If this debug serial port of judgement is not taken by other nuclear locking, then lock this debug serial port, the output Debugging message, and after all Debugging message are all exported, remove locking to this debug serial port.When utilizing debug serial port to receive the input Debugging message, the nuclear that needs to receive the input Debugging message interrupts earlier the output of this debug serial port, receives the input Debugging message by this debug serial port then.
In realizing process of the present invention, the inventor finds that there are the following problems at least in the prior art:
When a plurality of nuclears needed to export Debugging message simultaneously, the nuclear of failing to take this debug serial port need to ceaselessly detect spin-lock or com-state position, seeks the opportunity that this debug serial port is disengaged locking, so that the output Debugging message.But because the debug serial port message transmission rate is lower, therefore, this testing process will take processor a large amount of running time, causes the waste of processor resource.
Summary of the invention
Embodiments of the invention provide a kind of using method and polycaryon processor of serial ports, can save processor resource.
A kind of using method of serial ports comprises:
Main stone grafting is received at least one from authorizing the Debugging message that send;
Main nuclear is exported the Debugging message of described reception by debug serial port.
A kind of polycaryon processor comprises that a main nuclear and at least one are from examining:
Wherein, described from nuclear, be used for the Debugging message of need output is sent to main nuclear;
Described main nuclear is used for receiving the described Debugging message that sends from nuclear, and the Debugging message of described reception is exported by debug serial port.
The using method of the serial ports that the embodiment of the invention provides and polycaryon processor receive Debugging message that at least one sends from nuclear by being examined by the master, and the Debugging message of described reception are exported by debug serial port.Therefore, do not need to detect the debug serial port state from nuclear, and according to debug serial port state output Debugging message, having saved is to detect the processor resource that com-state spent, and has effectively avoided each to examine the situation of the staggered confusion of type information that causes when directly exporting by debug serial port respectively.
Description of drawings
Fig. 1 is the using method synoptic diagram of embodiment of the invention serial ports;
Fig. 2 is the formation synoptic diagram of embodiment of the invention polycaryon processor.
Embodiment
In order to be illustrated more clearly in the technical scheme of the embodiment of the invention, the accompanying drawing of required use is done an introduction simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
In order to save processor resource, the embodiment of the invention provides a kind of using method of serial ports, and as shown in Figure 1, the using method of embodiment of the invention serial ports comprises:
101, main stone grafting is received at least one from authorizing the Debugging message that send.
In embodiments of the present invention, a plurality of nuclears of polycaryon processor are divided into a main nuclear and a plurality of from nuclear.This division operation is generally Default Value, in addition, also can specify main nuclear by the user.
Main endorse with by internuclear communications reception at least one from authorizing the Debugging message that send, described after authorize the Debugging message that send and can handle through the buffer memory packing or by bytes store, by giving from authorizing.
For example, from endorsing, send to main nuclear through the buffer memory packing or by the Debugging message after the bytes store processing by internuclear communication with described with the Debugging message buffer memory packing of output or by bytes store.In embodiments of the present invention, described internuclear communication comprise between each core by the bus that connects core communicate and each core between pass through message communicating.
102, main nuclear is exported the Debugging message of described reception by debug serial port.
Main nuclear can also be exported the Debugging message of self except the Debugging message that receives is exported by debug serial port by debug serial port.For example, the Debugging message of main nuclear is directly exported by debug serial port, perhaps, the Debugging message and the Debugging message of main nuclear that receive are exported by debug serial port together.
Be specifically as follows:
When debug serial port was used to export the Debugging message of main nuclear, main nuclear carried out the flow configuration according to the Debugging message of main nuclear self.Main nuclear is according to described flow configuration result, directly by debug serial port output Debugging message.The Debugging message of described debug serial port output is received by external unit, and described external unit can be equipment such as printer.
Be used to export that main stone grafting receives by when authorizing the Debugging message that send at debug serial port, main stone grafting is received after authorize the described Debugging message that send, and main nuclear carries out the flow configuration according to the described Debugging message that receives.And according to described flow configuration result, export the Debugging message of described reception by debug serial port.The Debugging message of described debug serial port output is received by external unit, and described external unit can be equipment such as printer.Therefore, can export by multiplexing debug serial port, improve the utilization factor of debug serial port from the Debugging message of nuclear.
Main stone grafting receives by when authorizing the Debugging message of the Debugging message that send and main nuclear when debug serial port is used to export, main stone grafting is received after authorize the described Debugging message that send, and main nuclear carries out the flow configuration according to the Debugging message of main nuclear self and the Debugging message of described reception.Main nuclear is exported the Debugging message of main nuclear and the Debugging message of described reception according to described flow configuration result by debug serial port.The Debugging message of described debug serial port output is received by external unit, and described external unit can be equipment such as printer.Therefore, can export by multiplexing debug serial port, improve the utilization factor of debug serial port from the Debugging message of nuclear and the Debugging message of main nuclear.
In addition, if in above-mentioned three kinds of situations, the flow summation of the Debugging message that need export reaches the flow restriction of debug serial port, then the Debugging message that surpasses the flow restriction part is carried out buffer memory, when debug serial port is idle relatively, export by debug serial port, perhaps directly will abandon above the Debugging message of flow restriction part.
In addition, main nuclear can also receive serial ports input data by debug serial port, at least one from authorize send described from checking the serial ports input data of answering.
Be specifically as follows: after main nuclear receives serial ports input data by debug serial port, main nuclear is according to the corresponding relation from nuclear and target nuclear sign, and the target nuclear sign in the described serial ports input data, determine correspondingly to the target nuclear sign in the described serial ports input data examining, definite send described serial ports to import data from authorizing to described.
Can be when Default Value, be main nuclear and from examining the target nuclear sign of pre-configured correspondence, and by corresponding relation of the corresponding target nuclear with it of this main nuclear of main nuclear record sign, and should examine the corresponding relation that identifies from the corresponding target of nuclear with it.Wherein, described target nuclear sign is used to distinguish different nuclear.Be main nuclear and to distribute the mode of target nuclear sign to have from nuclear a variety of, for example, for each nuclear Allotment Serial Number etc.In addition, can also put corresponding target nuclear sign from the main nuclear of behavior with from caryogamy, and examine the corresponding relation that the corresponding target nuclear with it of this main nuclear of record identifies by main by the user, and should be from the corresponding relation of the corresponding target nuclear with it of nuclear sign.The user is main nuclear and can has a variety of from the mode that target nuclear sign is put in caryogamy.For example, the master examines and identical user interface is provided from nuclear, and the user can be respectively the main target nuclear sign of examining and putting correspondence from caryogamy respectively by main nuclear with from the user interface that nuclear provides.To send to main nuclear from checking the target nuclear sign of answering by internuclear communication with described from the user interface of nuclear.Main stone grafting is received described after authorize the target nuclear sign of sending, and write down describedly from the corresponding relation of nuclear with described target nuclear sign, and main nuclear has also write down main nuclear and examined the corresponding relation that identifies with the target of putting for this main caryogamy.
Main nuclear drives and will send to main nuclear by the serial ports input data that debug serial port receives, and wherein, comprises the target nuclear sign of the reception object of these serial ports input data in the described serial ports input data.After main stone grafting is received serial ports input data, corresponding relation according to configuration from nuclear and target nuclear sign, and the target nuclear sign in the described serial ports input data, determine corresponding with the target nuclear sign in the described serial ports input data from examining, the target nuclear sign that promptly main nuclear is imported serial ports in the data is marking matched with the target nuclear of each nuclear of configuration, determines to need to receive the nuclear of handling these serial ports input data.Main nuclear need to have determined to receive serial ports input data behind nuclear, definite send described serial ports input data to described from authorizing.Because the serial ports that main stone grafting is received input data may be issued a plurality of from nuclear, therefore, main nuclear sends at least one corresponding with it from nuclear with described serial ports input data.
For example, if main nuclear is according to the corresponding relation from nuclear and target nuclear sign of configuration, and the target nuclear sign in the described serial ports input data, the part or all of serial ports input data that determine to receive are to main nuclear, then will part or all of serial ports input data transfer to the main operating system of examining and carry out respective handling.If main nuclear is according to the corresponding relation from nuclear and target nuclear sign of configuration, and the target nuclear sign in the described serial ports input data, the part or all of serial ports input data that determine to receive to certain from nuclear, should from nuclear for this part or all of serial ports input data correspondence from nuclear.Main nuclear should part or all of serial ports input data send to this from nuclear, should the serial ports input data that receive be transferred to this operating system from nuclear carry out respective handling from nuclear after receive these part or all of serial ports input data.
Therefore, when receiving, handling according to the method described above, import data from the serial ports of nuclear or main nuclear and import, improved the utilization factor of debug serial port by multiplexing debug serial port from nuclear or the main serial ports input data of examining.
In addition, the input and output of debug serial port can be used interrupt mode, carry out the interrupt operation that inputs or outputs of debug serial port by main nuclear.
The using method of the serial ports that the embodiment of the invention provides receives Debugging message that at least one sends from nuclear by being examined by the master, and the Debugging message of described reception is exported by debug serial port.Therefore, need before the output Debugging message, not detect the debug serial port state from nuclear, having saved is to detect the processor resource that com-state spent, and has effectively avoided each to examine the situation of the staggered confusion of type information that causes when directly exporting by debug serial port respectively.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, to come the relevant hardware of instruction to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process such as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
In addition, the embodiment of the invention also provides a kind of polycaryon processor, and as shown in Figure 2, embodiment of the invention polycaryon processor comprises that at least one is from examining 201 and main nuclears 202:
Wherein, described from examining 201, the Debugging message that is used for exporting sends to main nuclear 202;
Described main nuclear 202, described from examining 201 Debugging message that send for receiving, the Debugging message of described reception is exported by debug serial port.
Describedly further specifically comprise Serial Port Information processing unit and Serial Port Information transmitting element from examining 201.Wherein, described Serial Port Information processing unit is used for the Debugging message buffer memory packing of output or by bytes store.Described Serial Port Information transmitting element is used for by internuclear communication the Debugging message after the Serial Port Information processing unit processes being sent to main nuclear 202.
Described main nuclear 202 further comprises output data receiving element and output data transmitting element.Wherein, described output data receiving element is used for by internuclear communications reception described from examining 201 Debugging message that send, described output data transmitting element, be used for the Debugging message that described output data receiving element receives being exported by debug serial port according to the flow configuration.In addition, described output data transmission unit is also exported by debug serial port for the Debugging message that will lead nuclear 202.
In addition, in order to receive serial ports input data, described main nuclear 202 also comprises input data receiver unit and input data transmission unit.Wherein, described input data receiver unit is used for receiving serial ports input data by debug serial port.Described input data transmission unit is used at least one described from examining the serial ports input data of 201 correspondences from examining 201 transmissions.Correspondingly, describedly also comprise the data receiver unit from examining 201, be used for receiving the serial ports input data that sent by main nuclear 202.
In addition, describedly also comprise the sign transmitting element, be used for and send to main nuclear 202 from examining 201 corresponding target nuclear signs by internuclear communication with described from examining 201.Correspondingly, described main nuclear 202 also comprises sign receiving element, identification record unit and from the nuclear determining unit.Wherein, described sign receiving element is used for by internuclear communications reception by that send and described from examining 201 corresponding target nuclear signs from examining 201.Described identification record unit, be used for recording described from examine 201 with the corresponding relation of described target nuclear sign.Described from the nuclear determining unit, be used for according to described from examine 201 with the corresponding relation of target nuclear sign, and the target nuclear sign in the described serial ports input data, determine with described serial ports input data in target nuclear identify corresponding to examining 201.
In order to control the input and output of debug serial port, described main nuclear 202 also comprises interrupt location, is used to carry out the interrupt operation that inputs or outputs of debug serial port.
The polycaryon processor that the embodiment of the invention provides receives Debugging message that at least one sends from nuclear by being examined by the master, and the Debugging message of described reception is exported by debug serial port.Therefore, need before the output Debugging message, not detect the debug serial port state from nuclear, having saved is to detect the processor resource that com-state spent, and has effectively avoided each to examine the situation of the staggered confusion of type information that causes when directly exporting by debug serial port respectively.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.
Claims (14)
1. the using method of a serial ports is characterized in that, comprising:
Main stone grafting is received by at least one from authorizing the Debugging message that send;
Main nuclear is exported the Debugging message of described reception by debug serial port.
2. the using method of serial ports according to claim 1 is characterized in that, also comprises:
Main nuclear is exported the Debugging message of self by debug serial port.
3. the using method of serial ports according to claim 1 is characterized in that, described main stone grafting is received and is specially from authorizing the Debugging message that send by at least one:
Main nuclear by internuclear communications reception by at least one from authorizing the Debugging message after the handling of sending through the buffer memory packing or by bytes store.
4. according to the using method of claim 1 or 3 described serial ports, it is characterized in that described main nuclear is specially the Debugging message of described reception by debug serial port output:
Main nuclear is exported the Debugging message of described reception according to the flow configuration result that the Debugging message by described reception obtains by debug serial port.
5. the using method of serial ports according to claim 1 is characterized in that, also comprises:
Main nuclear receives serial ports input data by debug serial port;
Main nuclear at least one from authorize send described from checking the serial ports input data of answering.
6. the using method of serial ports according to claim 5 is characterized in that, also comprises:
Main nuclear is examined sign with described from checking the target of answering by what send from nuclear by internuclear communications reception;
Main nuclear record is described from the corresponding relation of nuclear with described target nuclear sign.
7. according to the using method of claim 5 or 6 described serial ports, it is characterized in that described main nuclear describedly is specially from checking the serial ports input data of answering from authorizing to send at least one:
Main nuclear is according to described corresponding relation from nuclear and target nuclear sign or default from the corresponding relation of nuclear with target nuclear sign, and the target nuclear sign in the described serial ports input data, determines corresponding to the target nuclear sign in the described serial ports input data examining;
Definite send described serial ports input data from nuclear to described.
8. the using method of serial ports according to claim 1 is characterized in that, also comprises:
Main nuclear carries out the interrupt operation that inputs or outputs of debug serial port.
9. a polycaryon processor is characterized in that, comprises that a main nuclear and at least one are from examining:
Wherein, described from nuclear, be used for the Debugging message of need output is sent to main nuclear;
Described main nuclear is used for receiving the described Debugging message that sends from nuclear, and the Debugging message of described reception is exported by debug serial port.
10. polycaryon processor according to claim 9 is characterized in that, describedly comprises from nuclear:
The Serial Port Information processing unit is used for the Debugging message buffer memory packing of output or by bytes store;
The Serial Port Information transmitting element is used for by internuclear communication the Debugging message after the Serial Port Information processing unit processes being sent to main nuclear;
Described main nuclear comprises:
The output data receiving element is used for by internuclear communications reception described from authorizing the Debugging message that send;
The output data transmitting element is used for the flow configuration result that obtains according to the Debugging message that is received by described output data receiving element, and the Debugging message that described output data receiving element receives is exported by debug serial port.
11. polycaryon processor according to claim 10 is characterized in that, described output data transmission unit is also exported by debug serial port for the Debugging message that will lead nuclear.
12. polycaryon processor according to claim 10 is characterized in that, described main nuclear also comprises:
Input Data Receiving unit is used for receiving serial ports input data by debug serial port;
The input data transmission unit is used for sending at least one from nuclear described from checking the serial ports input data of answering.
13. polycaryon processor according to claim 10 is characterized in that, described from nuclear also comprise:
The sign transmitting element is used for and will sends to main nuclear from checking the target nuclear sign of answering by internuclear communication with described;
Described main nuclear also comprises:
The sign receiving element is used for examining sign with described from checking the target of answering by what send from nuclear by internuclear communications reception;
The identification record unit is used to write down described from the corresponding relation of nuclear with described target nuclear sign;
From the nuclear determining unit, be used for according to described from the corresponding relation of nuclear, and the target nuclear sign in the serial ports input data with target nuclear sign, determine corresponding with the target nuclear sign in the described serial ports input data from examining.
14. polycaryon processor according to claim 9 is characterized in that, described main nuclear also comprises:
Interrupt location is used to carry out the interrupt operation that inputs or outputs of debug serial port.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101199882A CN101493808B (en) | 2009-02-26 | 2009-02-26 | Serial using method and multi-core processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101199882A CN101493808B (en) | 2009-02-26 | 2009-02-26 | Serial using method and multi-core processor |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101493808A CN101493808A (en) | 2009-07-29 |
CN101493808B true CN101493808B (en) | 2011-08-24 |
Family
ID=40924412
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009101199882A Active CN101493808B (en) | 2009-02-26 | 2009-02-26 | Serial using method and multi-core processor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101493808B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102117241A (en) * | 2009-12-30 | 2011-07-06 | 华为技术有限公司 | Multi-core system debugging method and multi-core system |
CN102289368B (en) * | 2011-06-17 | 2017-09-05 | 中兴通讯股份有限公司 | A kind of method and system for obtaining serial printing information |
CN105389235A (en) * | 2015-10-28 | 2016-03-09 | 致象尔微电子科技(上海)有限公司 | Heterogeneous multi-core debug system and method |
CN105740155A (en) * | 2016-03-09 | 2016-07-06 | 惠州Tcl移动通信有限公司 | Debugging realizing method and system for Modem CPU |
CN107393594A (en) * | 2017-07-27 | 2017-11-24 | 郑州云海信息技术有限公司 | A kind of multinuclear solid state hard disc adjustment method and system |
CN113934521B (en) * | 2021-09-16 | 2024-06-04 | 山东有人物联网股份有限公司 | Serial data framing method, driving device and readable storage medium for UNIX system |
-
2009
- 2009-02-26 CN CN2009101199882A patent/CN101493808B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN101493808A (en) | 2009-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100568187C (en) | A kind of method and apparatus that is used for debugging message is carried out mask | |
CN101493808B (en) | Serial using method and multi-core processor | |
US20090327552A1 (en) | Method and System for Secure Communication Between Processor Partitions | |
CN104111870A (en) | Interrupt processing device and method | |
CN104793996A (en) | Task scheduling method and device of parallel computing equipment | |
CN102855199A (en) | Data processing device and data processing arrangement | |
CN113342727A (en) | Signal transmission device, method, computer equipment and storage medium | |
CN106126465A (en) | A kind of data transmission method and device | |
US20240086339A1 (en) | Systems, methods, and devices for accessing a device operating system over an interconnect | |
CN110008003A (en) | A kind of order line validation checking method and relevant apparatus | |
CN203746067U (en) | Multi-path ARINC 429 data receiving and transmitting circuit structure based on DSP and CPLD development | |
CN107229591B (en) | Multi-serial port communication method and device | |
CN102495815B (en) | Processing method for I/O (input/output) data access interrupt, system and equipment | |
CN112035239A (en) | Task scheduling method and device, terminal equipment and storage medium | |
CN100563175C (en) | Obtain method, the Apparatus and system of equipment running status | |
CN111277514A (en) | Message queue distribution method, message forwarding method and related device | |
CN102023957A (en) | Method for stimulating multiple serial ports by a USB interface for transmitting data and USB compound device | |
CN104102613A (en) | Electronic equipment and information processing method | |
WO2010050957A1 (en) | Bit inversion for communication interface | |
CN112130904B (en) | Processing system, inter-processor communication method, and shared resource management method | |
CN109542812A (en) | Data communication control method, device and terminal device | |
CN110134638B (en) | Dual-processor data exchange method | |
CN111371799B (en) | Method, device and equipment for controlling data receiving and transmitting of MCTP (Multi-channel media Port) controller | |
CN102640129A (en) | Direct memory access device for multi-core system and operating method of the same | |
CN103503403B (en) | Data processing method and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |