TW385399B - A kind of management device and method for multi-stacks - Google Patents
A kind of management device and method for multi-stacks Download PDFInfo
- Publication number
- TW385399B TW385399B TW87112788A TW87112788A TW385399B TW 385399 B TW385399 B TW 385399B TW 87112788 A TW87112788 A TW 87112788A TW 87112788 A TW87112788 A TW 87112788A TW 385399 B TW385399 B TW 385399B
- Authority
- TW
- Taiwan
- Prior art keywords
- stack
- main frame
- main
- stacking
- data
- Prior art date
Links
Landscapes
- Executing Machine-Instructions (AREA)
Abstract
Description
五、發明説明(1 ) A7 B7 經濟部中央揉準局貝工消费合作社印装 發明領域 本發明是和堆疊管理單元相關的發明,尤其是將— 個堆#管理單元中的多堆養合併成為—個主要的主框堆 疊(frame stack)來管理,以降低系統管理額外的負擔。 發明背景 在個堆吞機器(stack machine)中,主要係利用一個 FILO (First In Last Out)的資料儲存裝置(例如:一個堆 曼)·來做執行_存資料的機構,此種裝置_可健存許多 筆資料。指令執行㈣統會自動將堆衫前端的一個或 數個運算元(operands)取出做所需的運算,並在運算結束 後將結果放回堆疊的頂端去。 堆疊中資料係透過一堆疊指標存取。在資料堆疊 中,堆疊指標指向資料堆疊尾端的最後一筆資料,這個 位置亦被稱作堆疊頂端(T0p 〇f Stack),稱作頂端的原因 是堆疊的存取是以這個位置為準的。 舉例而言,當系統要執行一個,,加法"時,兩個運箕元 Dl,D2會從資料堆疊中被取出(p〇p),而後m、D2會被送 到算術邏輯單元(ALU)去執行加法運算 ,而得到一個運 算結果D、D’將被送回(存入)(pushed)至資料堆疊。因 此’在一個堆疊機器中,每個指令都可能會改變堆疊内. 容。tf料存入或由堆疊中取出時,堆疊指標會自動增 減以指向一個可利用的堆疊空間。 I '秀-- (請先閲讀背面之注意事項再填寫本頁) 4* ·(V. Description of the invention (1) A7 B7 Printed by the Central Government Bureau of the Ministry of Economic Affairs, Shellfish Consumer Cooperative Co., Ltd. FIELD OF THE INVENTION The present invention is an invention related to the stacking management unit, especially the combination of the multiple stacking in the — ### management unit. A main frame stack to manage to reduce the extra burden of system management. BACKGROUND OF THE INVENTION In a stack machine, a FILO (First In Last Out) data storage device (for example, a stackman) is mainly used as a mechanism for storing and storing data. Such a device can be Keep a lot of data. The instruction execution system will automatically take out one or more operands at the front of the stack to perform the required operation, and return the result to the top of the stack after the operation is completed. Data in the stack is accessed through a stack of indicators. In the data stack, the stack pointer points to the last piece of data at the end of the data stack. This position is also called the top of the stack (T0p 0f Stack). The reason for this is that the access of the stack is based on this position. For example, when the system needs to perform one, "addition", the two transport elements D1, D2 will be taken out of the data stack (p0p), and then m, D2 will be sent to the arithmetic logic unit (ALU) ) To perform the addition operation, and obtain an operation result D, D 'will be returned (stored) (pushed) to the data stack. Therefore, in a stacking machine, each instruction may change the contents of the stack. When tf material is stored in or removed from the stack, the stacking index will automatically increase or decrease to point to an available stacking space. I 'show-(Please read the notes on the back before filling out this page) 4 * · (
本紙張^圏困家樣率(CNS ) A7 B7 經濟部中央橾準局貝工消費合作社印製 五、發明説明(1 ) 由於資料堆疊會常常被使 (register)來設計資料堆番, 所以可以用暫存器 度。此種設計,如果所有組料之存取速 完了 (堆疊過溢’ 〇VerfW),疊的暫存器都被用 暫存器堆疊巾移至細屬攸、,_=少—個資料從 中作詳細討論),此妹體之紅:存空間t(將在後文 體之存取時間會較暫存器為長。 當=器㈣料耗盡時也 足—)β為使運算得以進行,系統便會 一 個資料從_記‘__暫料堆4。這錄疊過溢及 堆叠不足的處理可視為料__外貞擔,因為其和 程式執仃無關,只是系統的額外處理動作。 除了資料堆疊,一個堆疊機器還包含有其他以堆疊 方式動作的儲存區域,例如:儲存返回位址(return address)的返回堆叠,健存區域變數(i〇cai variabie)的區域 變數堆疊等等。這些堆疊各有一個堆疊指標,指向堆疊 開始之處,當要存取這些堆疊的時候,可利用其堆疊指 k作為開始位址。例如,如果要存取這個堆疊之第4個資 料’可利用下列式子計算其資料位置: E4SA,= SAP +(0V.x4); 其中: E4sa為第4個資料之開始位置;This paper ^ 圏 Sample home rate (CNS) A7 B7 Printed by the Central Consumers' Bureau of the Ministry of Economic Affairs, Printed by the Shellfish Consumer Cooperative, V. Description of the Invention (1) Since data stacks are often registered to design data stacks, you can Use register. With this design, if the access to all the components is completed (stacking overflow '〇VerfW), the stacking register is moved to the subordinate by using the register stacking towel, _ = less—a piece of data from which Discuss in detail), this girl's red: storage space t (the access time in the following style will be longer than the temporary register. It is sufficient when = device data is exhausted-) β In order to make the operation, the system There will be a data from _ 记 '__tentative material pile 4. The processing of over-overflow and under-stacking of this recording can be regarded as material __ Wai Zhen Dan, because it has nothing to do with program execution, but an additional processing action of the system. In addition to data stacking, a stacking machine also contains other storage areas that operate in a stacking manner, such as: return stacks that store return addresses, area variable stacks that store variables (iocai variabie), and so on. Each of these stacks has a stack index, which points to the beginning of the stack. When you want to access these stacks, you can use its stack index k as the starting address. For example, if you want to access the fourth data of this stack, you can use the following formula to calculate its data position: E4SA, = SAP + (0V.x4); where: E4sa is the starting position of the fourth data;
Sap為堆疊指標值(堆疊開始位置); 本紙張尺及遇《〒國國家標準(CNS ) A4規格(21〇x297公釐) ---------'^^.-- (請先閲讀背面之注意事項再填寫本頁)Sap is the stacking index value (stacking start position); this paper ruler meets the "National Standard (CNS) A4 specification (21 × 297 mm) --------- '^^ .-- (Please (Read the notes on the back before filling out this page)
1T Γ A7 ____·_B7五、發明説明(3 ) 經濟部中央標準局員工消费合作社印裝 ον為位移值(offset)(相對於堆疊中每個資料的長 度而定); 在一個物件導向系統中,堆疊機器是以活動記錄 (activation record)為單位來管理它的多個堆養。當一個物 件呼叫另一個物件時便會生一個活動記錄,而當這個新 物件執行結束時,因它產生的活動記錄也會被刪除。所 以當新的活動記錄產生時,每個堆叠的指標也會變化, 指向一個新的位址,而當此一活動記錄被刪除時,指標 又會返回其原先未呼叫此物件時位置。 如上所述,一個堆疊機器常常包含數個存放不同類 型資料之堆要’而這些堆疊管理的方式影響系統之執行 效能。系統花費愈多時間在管理堆叠上,它能用來執行 程式的時間就愈少’因此如何用最少的系統時間最有效 率的管理堆疊,便是本發明的重點β 在先前他人的研究中,最早期是將所有堆疊放在記 憶體中,由於記憶體存取太慢,常使得系統效能不佳。 而後在一些為執行Forth(—種以堆疊為基礎的語言)所設 計的系統中’便有人利用暫存器來儲存資料堆疊以提昇 系統效能’但單單將資料堆憂硬體化是否夠的,區域變 數也是一個在堆疊機器中常被存取的資料,將其储存在 記憶體中會大大降低系統效能。除此之外,先前的肋代11 機器並未提出一個有效處理堆疊過溢或堆疊不足的方 法。 麥紙張尺度逋用中國國家揉準(CNS ) A4规格(210X297公釐) ------------^ 装-- (請先閲讀背面之注意事項其填寫本頁) 訂 經濟部中央標準局貝工消费合作社印製 A7 B7 _' 五、發明説明(屮) 在暫存器或堆養造成的過溢或不足時處理的方法研 究中,一個方法是在精簡指令集系統Rise π採用的方 法。它的架構上也包含了一個多個暫存器所構成的堆疊 及一個記憶體構成的附屬儲存空間,而當堆疊過溢發生 時’ RISC II會將一個由固定數目暫存器構成的暫存器窗 的資料移至附屬储存空間。這個方法的問題是在處理堆 疊溢出的過程中系統的程式執行必須暫停’直到堆疊溢 出的處理完畢為止,這將會造成系統的大量處理負擔。 圖一顯示另外一個在u. s. Patent No. 5,107,457中提 出的方法,其專利主要内容如圖一所示’ 一使用堆疊指 標110、堆疊過溢指標120和堆疊不足指標130之堆疊1〇〇 以及一第二堆疊(未顯示在圖上假設將目前堆疊位址 設定為140A至140L,如圖所示’其中140A—方面是堆疊 的第一個位置,另一方面也是140L的下一個位置》 在堆疊運作時,假設堆壘溢出指標120—開始時指向 140L的位址,而堆疊不足指標130指向140D »每當一筆 資料存入堆疊100時,堆疊指標110便向前移動一個位 置。當堆疊指標因存入一筆資料而110撞上堆疊過溢指標 120時,系統便發生堆疊過溢》在這個情形下,堆叠過溢 指標120和堆疊不足130都增加1。同時’原本存在14〇八 的資料亦移給第二堆整。 反之若堆疊指標110因取出資料而撞上堆疊不足指 標130,則發生堆疊不足,一切動作將和先前所述相反, 在這個情形下,堆疊過溢指標120和堆疊不足13〇都減少 _________ - 6 · 本紙張纽適用中---- ---------f装丨| (請先閲讀背面之注意事項再填寫本頁) ,•17 經濟部中夫標準局貝工消費合作社印装 A7 _B7 τ 五、發明説明(5 ) 1。同時’ 一筆資料由第二堆疊移給堆疊1〇〇,譬如此筆 資料由第二堆疊存入位址104A。 在由 Philip J. Koopman所著的"Stack Computer: The Net Wave"—書中亦提到類似的方法,除了堆疊不足/過 溢時一次搬動半個堆疊的資料之差別外。本的發明和上 述各先前堆疊系統最大的不同在於,上述各先前堆疊系 統的各堆疊(資料堆疊、返回堆疊、區域堆疊等)需要分 別的管理機構來分別管理,而本發明提供一個裝置來管 理多個堆疊,以降低堆疊管理之額外負擔。 發明概述 本發明是一個智慧型多堆叠管理單元,本單元將多 個堆叠中的資料以主框(frame)堆叠内的部份主框(frame portion)的方式來管理,每個主框堆疊則由動態產生的活 動記錄來管理。除此之外,本發明利用一主堆疊和一附 屬堆疊來構成整個主框堆疊。 本發明亦利用一個堆出/裝入(spill/fill)偵測單元和控 制單元結合堆疊過溢/堆疊不足限制標示來處理堆疊過溢 和堆疊不足之狀況。這整個裝置可以在不停止系統正常 執行的狀況下,在發生堆疊過溢或堆疊不足時自動的將 資料在主堆疊和附屬堆疊中作適當的移動^ 控制單元在程式執行呼叫(call)和返回(return)指令時 管理主框之堆疊指標。譬如’在程式執行呼叫指令時, 系統會產生一個新的主框,而指向每個部份主框的堆疊 家標準( 〇泌)八4規格(210.«<297公釐) Λ,衮-- (請先W讀背面之注意事項再填寫本頁) 訂 Α7 Β7 經濟部中央揉準局員工消費合作社印裝 五、發明説明(6) 指標暫存器的b會因程式控制而加以修改,b其原4舊 的各堆疊指標值會依序存入返回堆養中。新的堆疊指標 值指向堆疊記憶體新產生之部分主框堆叠區。反之當程 式執行到返回指令時,則作反方向的動作,即自返回堆 疊中將上次存入的各舊堆疊指標值取出,存入堆昼指標 暫存器(register)中。詳細的動作將在後文敘述。 本發明會計算主堆疊資料之使用童,並訂出上限和 下限值,當主堆疊資料使用量超過上限或少於下限時, 便相對發生堆疊過溢或不足,此時某定量的資料便在主 堆疊和附屬堆疊中傳送。 本發明減少先前技藝需要分別管理各堆疊所造成的 額外負擔。此外,我們並在不停止系統執行狀況下作堆 疊過溢或不足時的處理,而提昇系統整體之效能。 圖式的簡單說明 為使本發明之上數目的、特徵、和優點能盛明顯易 僅’特舉一較佳實施例,並配合所附圖式,對本發明作 詳細之說明: 圖一是一個用來處理堆疊過溢及不足之先前技藝。 圖二說明如何將多個堆疊組合成一個主框以簡化堆疊之 ' 管理架構方塊圖β 圖三是本發明之堆疊管理單元的部份主框管理裝置一實 施例。 (請先閲讀背面之注意事項再填寫本頁) ./--¾ -* 本紙張跋通种目齡網^ (CNS) (21()><297公瘦) 五、發明説明( A7 B7 經濟部中央棣準局貝工消費合作社印裝 圖四是本發明將主框堆疊之結構的施實例,即主框堆疊 是由主堆疊和附屬堆疊組合而成的。 圖五是本發明之堆疊過溢/不足偵察機構的一實施例。 圖六是一個圖示說明如何將本發明和一個管線式中央處 理單元相連接。 圖七是本發明之堆疊管理單元的一實施例。 發明的詳細敘述 圖二說明如何將先前技藝的多堆疊系統組合成為〆 個主框以簡化堆叠之管理。如圖所示,N個堆疊(假設〆 堆疊系統有從堆疊1至堆疊N的多個堆疊)構成一個堆疊系 統如圖二上半所示。每個堆疊由不定數目個部份主框所 構成,每個部份主框中可能儲存有零到多個資料(未顯示 在圖中,資料數目因程式之不同而異)。在本例中,堆疊 1包含laWb兩個部份主框,其分別代表主框咐在堆爲 之㈣。同理’堆疊2包含部份主框和“ 刀別為主框a和b在堆吞2中儲存之資科;同理 中亦包含兩個部份主框Na和Nb。 每個堆#各自有簡,例如,堆疊 ^曰標卜堆昼2堆晏有指標2,同理堆叠N亦有堆^指# …在這所有的堆疊中,第N個堆叠騎料料 = 疊之堆疊指標指向堆疊的最後一筆資料。 的堆疊指標則指向堆叠的開頭處。 、他的堆疊 本紙張从適财ϋ目家縣(CNS) (2ωχ297公餐 1 Hi ......I .....- I II - I 1 ί 1 (锖先聞讀背面之泣意事項存填寫本 ΐτ f1T Γ A7 ____ · _B7 V. Description of the invention (3) Printed by the Consumer Cooperatives of the Central Standards Bureau of the Ministry of Economic Affairs ον is the offset (relative to the length of each material in the stack); in an object-oriented system The stacking machine manages its multiple stockings in units of activation records. When an object calls another object, an activity record is generated. When the execution of the new object ends, the activity record generated by it will also be deleted. Therefore, when a new activity record is generated, each stacked indicator will also change to point to a new address, and when this activity record is deleted, the indicator will return to its original position when the object was not called. As mentioned above, a stacking machine often contains several stacks of different types of data, and these stack management methods affect the performance of the system. The more time the system spends on managing the stack, the less time it can use to execute the program. Therefore, how to manage the stack most efficiently with the least system time is the focus of the present invention. In previous studies by others, The earliest is to put all the stacks in the memory, because the memory access is too slow, often making the system poor. Then in some systems designed to run Forth (a stack-based language), 'someone uses a register to store data stacks to improve system performance', but it is not enough to just harden the data stack. A local variable is also a piece of data that is often accessed in a stacked machine. Storing it in memory can greatly reduce system performance. Beyond that, the previous Rib11 machine did not propose a method to effectively deal with stack overflow or understack. Wheat paper size, using China National Standard (CNS) A4 (210X297 mm) ------------ ^ Packing-(Please read the precautions on the back first and fill out this page) Printed by the Central Bureau of Standards, Shellfish Consumer Cooperatives A7 B7 _ 'V. Description of the Invention (屮) In the method research of overflow or inadequacy caused by temporary storage or stocking, one method is to reduce the instruction set system Rise Method used by π. Its architecture also includes a stack of multiple registers and an auxiliary storage space composed of a memory. When a stack overflow occurs, RISC II will store a temporary register of a fixed number of registers. The data of the window is moved to the attached storage space. The problem with this method is that in the process of processing stack overflow, the system program execution must be suspended 'until the stack overflow is processed, which will cause a large processing load on the system. Figure 1 shows another method proposed in US Patent No. 5,107,457. The main content of the patent is shown in Figure 1. 'One stacking index using stack index 110, stack overflow index 120, and under stack index 130, and A second stack (not shown on the picture, assuming that the current stack address is set to 140A to 140L, as shown in the figure 'where 140A is the first position of the stack, on the other hand it is the next position of 140L') During stacking operation, suppose that the stack overflow indicator 120—at the beginning, points to an address of 140L, and the understack indicator 130 points to 140D »Whenever a piece of data is stored in the stack 100, the stack indicator 110 moves forward by one position. When the stack indicator When 110 hits the stack overflow index 120 due to a deposit of data, the system has a stack overflow. "In this case, both the stack overflow index 120 and the stack under 130 are increased by 1. At the same time, the original data of 1408 It is also moved to the second stack. On the contrary, if the stacking indicator 110 hits the under stacking indicator 130 due to the fetching of data, an under stacking occurs, and all actions will be opposite to those previously described. In this case, the stack overflow index 120 and the stack under 13 are both reduced. _________-6 · This paper is applicable ---- --------- f pack 丨 | (Please read the note on the back first Please fill in this page for further information), • 17 Printed A7 _B7 τ printed by the Shellfish Consumer Cooperatives of China ’s Standards Bureau of the Ministry of Economic Affairs 5. Description of the Invention (5) 1. At the same time, a piece of data is transferred from the second stack to the stack 100, such as this The data is stored in the second stack at address 104A. A similar method is mentioned in "Stack Computer: The Net Wave" by Philip J. Koopman, except that when the stack is insufficient / overflow, it is moved once. The difference between the data of the half stack is the biggest difference between the present invention and the previous stacking systems described above. Each stacking (data stacking, return stacking, regional stacking, etc.) of each previous stacking system requires a separate management mechanism The present invention provides a device to manage multiple stacks to reduce the extra burden of stack management. SUMMARY OF THE INVENTION The present invention is an intelligent multi-stack management unit. This unit stacks the data in multiple stacks in a main frame. Part of the main frame (frame portion), each main frame stack is managed by a dynamically generated activity record. In addition, the present invention uses a main stack and an auxiliary stack to form the entire main frame stack The present invention also utilizes a spill / fill detection unit and a control unit in combination with a stack overflow / understack limit flag to handle stack overflow and understack conditions. This entire device can be used without stopping the system Under normal execution conditions, when the stack overflows or the stack is insufficient, the data is automatically moved in the main stack and the auxiliary stack appropriately. The control unit manages the main frame when the program executes the call and return instructions. The stacking indicator. For example, 'When the program executes a call instruction, the system will generate a new main frame, and the stacker standard (〇 Mi) 8 4 specifications (210. «≪ 297 mm) pointing to each part of the main frame Λ, 衮-(Please read the precautions on the back before filling out this page) Order Α7 Β7 Printed by the Central Consumers Bureau of the Ministry of Economic Affairs and printed by the Consumer Cooperatives V. Description of the invention (6) b of the index register will be modified due to program control , B the original 4 old stacking index values will be sequentially stored in the return stocking. The new stacking index value points to the newly generated part of the main frame stacking area of the stack memory. Conversely, when the program executes the return instruction, it will act in the opposite direction, that is, from the return stack, the old stack index values stored last time will be taken out and stored in the heap day index register (register). The detailed operation will be described later. The invention calculates the usage of the main stack data, and sets the upper and lower limits. When the main stack data usage exceeds the upper limit or less than the lower limit, the stack overflow or insufficient occurs relatively. At this time, a certain amount of data will be used. Teleport in main stack and sub stack. The present invention reduces the extra burden caused by previous techniques that required separate management of each stack. In addition, we do not deal with stack overflows or underflows without stopping the execution of the system to improve the overall system performance. Brief description of the drawings In order to make the number, features, and advantages of the present invention obvious and obvious, only a preferred embodiment is given, and the present invention is described in detail with the accompanying drawings: FIG. 1 is a Previous techniques used to deal with stack overflows and underfills. Figure 2 illustrates how to combine multiple stacks into a main frame to simplify stacking. Management architecture block diagram β Figure 3 shows an embodiment of a main frame management device of a stack management unit of the present invention. (Please read the notes on the back before filling in this page) ./--¾-* This paper is an official website of the Net of ^ (CNS) (21 () > < 297 male thin) V. Description of the invention (A7 B7 Printed by the Central Laboratories of the Ministry of Economic Affairs, Shellfish Consumer Cooperatives. Figure 4 is an example of the structure of the main frame stacking of the present invention, that is, the main frame stacking is a combination of the main stack and the auxiliary stacking. An embodiment of a stack overflow / underrun detection mechanism. Figure 6 is a diagram illustrating how the present invention is connected to a pipelined central processing unit. Figure 7 is an embodiment of a stack management unit of the present invention. Details of the invention The description in Figure 2 explains how to combine previous multi-stack systems into one main frame to simplify stack management. As shown in the figure, N stacks (assuming the stack system has multiple stacks from stack 1 to stack N) A stacking system is shown in the upper half of Figure 2. Each stack is composed of an indefinite number of partial main frames, and each partial main frame may store zero or more data (not shown in the figure. Programs vary). In this example, the heap 1 contains two main frames of laWb, which respectively represent the main frame and are commanded to be piled in the heap. Similarly, 'stack 2 contains some of the main frame and "knives are the main frames a and b. Similarly, the two main frames Na and Nb are also included. Each pile # has its own Jane, for example, the stack ^ is the standard stack, the second stack has the index 2, and the same is true for the N stack. #… In all the stacks, the Nth stacking material = the stacking index of the stack points to the last piece of data in the stack. The stacking index of the stack points to the beginning of the stack. Counties (CNS) (2ωχ297 公 餐 1 Hi ...... I .....- I II-I 1 ί 1 (锖
• m I 五、發明説明(? A7 B7 如圖二下半圖形所示’我們以主框為處理單位將屬 於同一個主框的各個部份主框組合在一起置放於主框堆 叠20中。例如圏二所示,將la,2a,3a,…至Na為止的所有 由a主框構成的各部份主框組合在一起,而後以v主框 的形式儲存在主框堆叠20中。 一個主框是本發明的基本管理單元,當一個新的主 框產生時(由一個呼叫指令產生的),例如,主框,,b"系統 在主堆疊中安排一塊區域,此區域包含了所有原本堆疊1, 2, 3,…至N所儲存的所有資料,而此主框區域儲存最後的 一個堆疊(如圖二之堆疊N)是資料堆疊,其堆疊指標指向 此部份主框最後一筆資料的尾端。如果以堆疊的存取方 式來說’主框的尾端即為堆疊的頂端(top 〇f stack),因此 貧料堆疊指標亦指向此主框的頂端,此後的討論中我們 將以堆疊的頂端稱吟主框或部份主框之尾端,即如圖二 所指向的部份主框Nb指標所指的位置。因此,此一指標 Nb亦稱為堆疊頂端,簡稱T〇s (Top Of Stack)。其他N-1 個部份主框之指標皆向其部份主框開始之起端。 ---------(袈-- (請先閲讀背面之注意事項再填寫本頁} 訂 經濟部中央標準局員工消費合作社印製 堆疊管理系統的細節將在稍後描述’此處再舉一些 例子說明圖二。例如,若主框"a”有10個資料在資料堆 曼’堆疊管理系統將分配十個資料空間在堆疊N中給部 份主框"Na"。主框V,可能有6個區域變數,且區域變數 存在堆疊1中成為部份主框"la",則部份主框”la"的資料 空間為6 ;有1個返回位址,存在罐疊2中成為部份主框 "2a”。主框”b"可能有8個資料,且存在堆疊N中成為部份 -10 - 令輯尺及邋用中國國家標準(CNS ) A4規格(210X297公釐) A7 B7 經濟部中央標準局員工消費合作社印裝 五、發明説明(兮) 主框’W,則部份主框”Nb"的資斜空間為8 d再宥s王椎 ”b”沒有區域變數和所以不佔任何堆疊1的空間。主框"b” 可能有1個返回位址,因此佔1個堆疊2空間成為部份主框 "2b"。主框汪和1>的各部份主框之>:小將依其實際狀況而 不同。而在我們的發明中,分配姶主框"a”的空間即等於 部份主框la,2a,…至Na之所有空間的和。 圖三是部份主框管理裝置30之具體實施例。以本發 明堆疊管理單元而言,指標暫存器1至N儲存最後一個主 框(最頂端的主框)的所有部份主框的指標值,而存入或 取出暫存器資料則是由處理機(未畫出)發出的控制訊號 31控制控制單元36來完成》 當處理機由主框堆疊讀取資料時,譬如說從圖二中 之主框”b”,主框”b”的各部分主框之堆疊指標是由相對應 的指標暫存器(PTR registers)中讀出。特別是控制單元36 回應控制訊號31而發出讀出訊號32來控制資料取出。暫 存器33接收讀出訊號32後經由匯流排37,將指標暫存器 中主框”b”的堆疊指標送給控制暫存器(c〇ntr〇1 registers)(圖中未顯示)。然後’主框"a”的各部分主框之 堆疊指標則由一返回堆疊取出,寫入相對應的指標暫存 器中。特別是控制單元36發出寫入訊號34,暫存器35接 收寫入訊號34後,將主框”a”的堆叠指標由返回堆叠取出 送入指標暫存器。在本發明之一實施方式中,主框”a”的 堆疊指標可以被存成為主框"b"的部份主框。如此,當主 各纸張適用中國囷家標準(CNS ) A4規格(2丨0X297公釐) ----------^ ^ — (請先閲讀背面之注意事項再填寫本頁) -IT- 五、發明説明(丨ο) 標 ==:Γ:主框,,,’讀取主框、"原本的指 當處理機呼叫-新主框時,譬如❹H ,各部分主框之堆衫標是由相對應 ^ 出。特別是控制單元36喊㈣Μ 腎益1f讀 32來控制資料取出。蘄六Γ制訊镜31而發出讀出訊號 法排37鮮料力暫存㈣接收讀*訊號32後經由匯 =37,將指標暫存器中主框"a„的堆疊__—返回 ,tJe , hi 、便主框b的各部分主框之堆叠 指標則由控制暫存器中穹入沪择狀六„上 ^ S - 1, ^ 馬入扣標暫存态中。特別是控制 發出寫人訊號34,暫存器35純寫人訊號34後, 將主框,V的堆4難由㈣暫存^送人純暫存器。 經濟部中央標準局貝工消費合作社印製 舉例說明,在-物件導向系統中,物件”a,,的執行可 能產生主框"a" ’且物件’V的執行可能產生主框,,b"。當 一現存物件,,a”的執行呼叫一新物件"b"時,物件"a"發出 :·’呼叫物件b”之指令。處理機回應此指令而發出一連串 才曰?,例舉如下:(1)將物件”a"的指標儲存在物件,,b"的返 回堆叠中,(2)將物件a”的指標加上一位移數以計算物件 b”的指標;以及(3)以計算所得之新值(”b,,的指標值)更新 指標暫存器(PTR 1至PTRN)。 雖然對硬體電路而言每一指標暫存器和相對之控制暫 存器皆相同,PTR N(例如,資料部分主框之指標)指向主 框堆4之頂端主框的資料N尾端。因此,ptr N亦指向主 框堆疊之TOS位置。資料部分主框是以堆疊方式被存 取’當欲取出資料時’是由資料部分主框的尾端取出資 -12 - 本紙張適用中國國家標準(CNS) A4^g_ (21QX297公瘦) 經濟部中央橾準局員工消費合作社印製 A7 B7五、發明説明(") 料,而資料部分主框的指標則往後退以指向下一個資料 位置。當欲存入資料時,資料是存入資料部分主框的尾 端,而資料部分主框的指標則往前移以指向此新資料位 置。 其他非屬π資料部分主框"的部分主框(以下稱非-資料 部分主框)之指標(例如:PTR 1至PTR N_l),則都指向各 所對應部分主框的開始處,這些非-資料部分主框是以生 ^(heap)方式來存取,且因為非-資料部分主框可能又擁 有多重元素(multi-element),故無論要讀出或寫入某一筆 元素時,皆係利用非-資料部分主框之堆疊指標加上一此 筆元素位移值來運作。例示如下,當要存取非-資料部分 主框某一筆元素時,處理機將一指標名稱和一位移值提 供給控制單元,此指標名稱指向此筆元素所屬之非-資料 堆疊,而此位移值則向控制單元標示出此筆元素相對於 非-資料部分主框之指標的儲存位置。控制單元則先取得 對應此指標名稱存在指標暫存器中之值,然後將取得值 加上位移值,且以相加之值來存取此筆元素。 在一傳統系統中,每一各別的堆疊有一各自的堆疊管 理系統加以管理,因此,需要一些個別的堆疊管理系統 以支援系統運作。這稜重複管理之運作方式,會嚴重降 低系統效能。 本發明以部分主框方式來管理來自不同堆疊的元素, 再將這些部分主框群集成主框群而成為一主框堆疊加以 管理。把個別的元素以一主框方式加以管理,本發明之 -13 - 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297公釐) ---------f 裝------ir—r----f (請先閱讀背面之注意事項再填寫本頁) 經 中 央 橾 隼 局 貝 工 消 費 合 作 社 印 % 五 、發明説明(il ) 低系統因要管理個別堆叠所造成的負 此則可提高系統之處理效能。 系統在m’將用—主框堆養來稱啤本發明之堆叠組織 中’,框内之部分主框在實雜上是位於個別堆叠 譬如圖—中所示的堆疊I至堆疊Ν。 一上發明一實施例如圖四所示’以-主堆疊41(譬如: 暫存态堆疊)和一次堆疊42(譬如:一 =主㈣財術=== 體可: = = ?憶體來達成’而快取記憶 疋在處理機Β日片中或疋分開在另_晶片中。主堆 $固定大小’例如基於程式之執行特徵,可藉著,過溢/ H f之選擇’而在任一給定時間時來適度運用主 =路:=項一^ 主堆私時’,過溢的錄或部分錄儲存入 中,次堆疊42—般係位於存取時間比存取主堆 長讀存魏卜次料42可位於,譬如磁性儲 士置、光學储存裝置、或其他合適的多容量儲存裝置 程式執行時,被儲存主框的數目將因由絲堆疊中取 出=存入主框而隨機變動’所以,主堆疊41便會產生過 溢或不足。在主框堆疊4G聽構中,—主框的第一部份 可能會是位於主堆昼41的底部,然而此主框的第二部分 -14 - 衣 訂 ^^Wm^m iCNS ) A4mr ( 2l'〇x297^ )'• m I V. Description of the invention (? A7 B7 As shown in the lower half of the figure 2, we use the main frame as the processing unit to combine the various main frames that belong to the same main frame in the main frame stack 20 For example, as shown in Fig. 2, all the main frames consisting of a main frame from la, 2a, 3a, ... to Na are combined, and then stored in the main frame stack 20 in the form of a v main frame. A main frame is the basic management unit of the present invention. When a new main frame is generated (generated by a call instruction), for example, the main frame, the b " system arranges an area in the main stack. This area contains all All the data stored in the original stack 1, 2, 3, ... to N, and this main frame area stores the last stack (as shown in stack N in Figure 2) is the data stack, and its stacking index points to the last of the main frame in this part The end of the data. If the access method of the stack is used, the 'end of the main frame is the top of the stack (top 0f stack), so the lean stack index also points to the top of this main frame. In the following discussion, we The main frame or part will be called the top of the stack The tail of the box is the position pointed by the indicator of the main frame Nb as shown in Figure 2. Therefore, this indicator Nb is also referred to as the top of the stack, referred to as TOS (Top Of Stack). The other N-1 The indicators of some main frames all start from the beginning of some main frames. --------- (袈-(Please read the precautions on the back before filling this page) Order the Central Bureau of Standards of the Ministry of Economic Affairs The details of the stack management system printed by the employee consumer cooperative will be described later. 'Here are some examples to illustrate Figure 2. For example, if the main frame " a' has 10 data in the data stack Man 'stack management system will allocate ten Data space in the stack N to part of the main frame " Na ". In the main frame V, there may be 6 regional variables, and the regional variables are stored in stack 1 as part of the main frame " la " The data space of "la" is 6; there is a return address, which is stored in the stack 2 as part of the main frame "2a". The main frame "b" may have 8 data, and it is stored as part of the stack N -10-Order ruler and application of Chinese National Standard (CNS) A4 specification (210X297 mm) A7 B7 Member of the Central Standards Bureau of the Ministry of Economic Affairs Industrial and consumer cooperatives 'printing V. Description of the invention (Xi) The main frame' W, then some of the main frame "Nb " has an oblique space of 8 d, and then the king vertebra" b "has no regional variables and therefore does not occupy any stacking. The main frame " b "may have a return address, so it takes up 1 stack 2 space to become part of the main frame " 2b ". Main frame Wang and 1 > of each part of the main frame >: The teenagers are different according to their actual conditions. In our invention, the space allocated to the main frame " a "is equal to the sum of all the spaces of some main frames la, 2a, ... to Na. FIG. 3 is a specific embodiment of a main frame management device 30. According to the stack management unit of the present invention, the index registers 1 to N store the index values of all parts of the main frame of the last main frame (the topmost main frame), and the register data is stored or retrieved by The control signal 31 sent from the processor (not shown) controls the control unit 36 to complete. When the processor reads data from the main frame stack, for example, from the main frame "b" and the main frame "b" in Figure 2 The stacking indicators of the main frame of each part are read out from the corresponding index register (PTR registers). In particular, the control unit 36 responds to the control signal 31 and sends out a read signal 32 to control data retrieval. After receiving the readout signal 32, the register 33 sends the stacking indicator of the main frame “b” in the indicator register to the control register (not shown) via the bus 37. Then the stacking indicators of the main frame of each part of the "main frame" are taken out by a return stack and written into the corresponding index register. In particular, the control unit 36 sends a write signal 34 and the register 35 receives After writing the signal 34, the stack index of the main frame "a" is taken out from the stack and returned to the index register. In one embodiment of the present invention, the stack index of the main frame "a" may be stored as the main frame " b " part of the main frame. In this way, when the main paper is applicable to the Chinese standard (CNS) A4 specification (2 丨 0X297 mm) ---------- ^ ^ — (Please read first Note on the back, please fill out this page again) -IT- V. Description of the invention (丨 ο) Mark ==: Γ: Main frame ,, 'Read main frame, " Originally referred to as handler call-New main frame When, for example, ❹H, the stacking marks of the main frames of each part are correspondingly displayed. In particular, the control unit 36 calls ㈣Μ 益 益 1f reads 32 to control the retrieval of data. 蕲 六 Γ makes a mirror 31 and sends out a read signal method Row 37 fresh material temporary storage. After receiving the read * signal 32, after the exchange = 37, the main frame " a „stacked in the index register __— returned, tJe, hi, the stacking index of the main frame of each part of the main frame b is controlled by the control register to enter the Shanghai Select State VI. ^ S-1, ^ The horse is entered into the temporary storage state of the deduction mark. In particular, the control sends a writer signal 34, the register 35 is purely written after the person signal 34, and the stack 4 of the main frame, V is difficult to be temporarily stored ^ and sent to the pure register. The Central Standards Bureau of the Ministry of Economic Affairs prints an example for illustration, in- In an object-oriented system, the execution of object "a" may generate a main frame " a " 'and the execution of object' V may generate a main frame ,, b ". When an existing object, the execution of a "calls a new object " b ", the object " a " issues a command: · 'calling object b". The processor responded to this command and issued a series of "?", For example: (1) Store the index of the object "a " in the return stack of the object, b ", (2) Add the index of the object a" to one The displacement number is used to calculate the index of the object b "; and (3) the index register (PTR 1 to PTRN) is updated with the calculated new value (" b ,, "the index value). Although each index register and the corresponding control register are the same for the hardware circuit, the PTR N (for example, the index of the main frame of the data part) points to the end of the data N of the top main frame of the main frame stack 4. Therefore, ptr N also points to the TOS position of the main frame stack. The main frame of the data part is accessed in a stacking manner. When the data is to be retrieved, the data is retrieved from the end of the main frame of the data part. -12-This paper applies Chinese National Standard (CNS) A4 ^ g_ (21QX297). Economic A7 B7 printed by the Consumers' Cooperative of the Ministry of Health and the Central Bureau of the Ministry of Foreign Affairs ("), and the main frame index of the data section moves backwards to point to the next data position. When you want to save data, the data is the end of the main frame of the stored data section, and the indicator of the main frame of the data section moves forward to point to this new data position. For other indicators that are not part of the main frame of the π data section (hereinafter referred to as the main frame of the non-data part) (for example: PTR 1 to PTR N_l), they all point to the beginning of the main frame of each corresponding part. -The main frame of the data part is accessed in a heap method, and because the main frame of the non-data part may have multi-elements, no matter when reading or writing a certain element, It uses the stacking index of the main frame of the non-data part plus an element displacement value to operate. An example is as follows. When an element of the main frame of the non-data part is to be accessed, the processor provides an index name and a displacement value to the control unit. The index name points to the non-data stack to which the element belongs, and the displacement The value indicates to the control unit the storage location of this element relative to the indicator of the main frame of the non-data part. The control unit first obtains the value stored in the indicator register corresponding to the indicator name, then adds the obtained value to the displacement value, and accesses the element with the added value. In a conventional system, each stack has its own stack management system to manage it. Therefore, some individual stack management systems are needed to support system operation. This duplication of management will seriously reduce system performance. The present invention manages elements from different stacks in a partial main frame manner, and then integrates these partial main frame groups into a main frame group to manage a main frame stack. Individual elements are managed in a main frame manner. -13 of the present invention-This paper size applies the Chinese National Standard (CNS) A4 specification (210X297 mm) --------- f equipment ---- --ir-r ---- f (Please read the notes on the back before filling out this page) Printed by the Central Bureau of Shellfisher Consumer Cooperatives% 5. Invention Description (il) Low system caused by the need to manage individual stacks The negative of this can improve the processing performance of the system. The system will be called the stacking organization of the present invention with the main frame stacking. Some of the main frames inside the frame are physically located in individual stacks, such as stacks I to N shown in the figure. An example of the first invention is shown in Figure 4. 'I-main stack 41 (for example: temporary storage stack) and one-time stack 42 (for example: one = main financial wealth === can be: = =? Memory to achieve 'The cache memory is stored in the processor B or in a separate chip. The main heap $ fixed size', for example, based on the execution characteristics of the program, can be selected by either overflow or H f ' Moderate use of the main = road: = item one ^ when the main heap is private, the overflow or partial recording is stored in the secondary stack 42-generally located in the access time longer than the main stack read access The Weibu second material 42 can be located, for example, when the magnetic storage device, optical storage device, or other suitable multi-capacity storage device program is executed, the number of stored main frames will be randomly changed because it is taken out from the silk stack = stored in the main frame 'So, the main stack 41 will have overflow or insufficient. In the main frame stack 4G structure, the first part of the main frame may be located at the bottom of the main stack day 41, but the second part of the main frame -14-Bookbinding ^^ Wm ^ m iCNS) A4mr (2l'〇x297 ^) '
經濟部中央襟準局員工消費合作社印製 五、發明説明(丨多) :可能會是位於:欠堆疊42的頂部(例如:主框X),這可能 是由於因主堆疊41過溢或不足,所產生的堆出/填入 (spill/fill)動作所造成。任何時候當主框堆壘中有資料時 便至少有一主框存在主堆疊中,以便處理機能迅速存取 資料。 在傳統堆疊中’當其產生過溢或不足時程式便得停止 執行’而處理機則需全神處理堆疊過溢或不足。本發明 便能克服此缺點,在處理堆疊過溢或不足時不需要暫時 停止系統處理機之正常執行程式。 圖五為一本發明之過溢/不足偵測電路50,依據系統 的需求一界限^51被定義出來,界限表51中可存有一組 或一組以上之過溢和不足界限值。過溢和不足界限值用 來決定暫存器堆疊’譬如圖四之主堆疊41,是否發生過 溢或不足。現行(current)活動紀錄的部分主框(例如:最 後存入主框堆疊内的主框部分),應放在主堆疊中。為了 保證這點,應將不足界限值選定為等於或大於現行活動 紀錄的大小。 界限選擇器52是用來選擇一過溢和不足界限值,隨著 程式之執行’界限選擇器52會動態的選擇過溢和不足界 限值’選擇方式將依據譬如子程式呼叫/返回的數次或頻 ' 率等程式執行特徵而定《舉例來說’若現行不足界限值 小於現行主框大小’界限選擇器52會從界限表51中選出 一新不足界限值。被選上的界限值係分別放在過溢界限 暫存|| 53和不足界限暫存器54中。 ___ - 15 - 从通用中固囷家標率(CNS> Μ祕(2! 〇 x 297公瘦) (請先閱讀背面之注事項再填寫本X) ------(装------灯--r Λ 經濟部中央標準局員工消費合作社印製 A7 _____ B7 五、發明説明(丨分) 堆疊頂端(TOS)暫存器55(將詳述於後面段落),指向 主堆受最仗之暫存1§位置(例如:一資料元素尾端)β而 堆疊底端(BOS)暫存器56,則指向主堆疊内最舊元素(譬 如:部分主框、部分主框之一字元等等),從T〇s值到 BOS值的暫存器數目等於現行主堆疊41中所使用之暫存 器數目。在本發明之一較佳實施例中,主堆疊係以多個 暫存器來實踐(參見圖四)。因此,主堆整41的使用量可 用TOS值和BOS值來計算。 在本發明之一實施例中,TOS值可為K+1位元,其中 之:MSB位元為T,而其他位元(LSBs)則為TOS值。BOS值 可為K+1位元’其中之MSB位元為’〇',而其他位元(lsBs) 則為305值。 藉著過溢/不足偵測電路50,產生一資料控制訊號來 標示是否需要從主堆疊中堆出或是要填入次堆疊中。特 別是,當主堆疊41的使用超出存在過溢界限暫存器53中 之過溢界限值時,一背景訊號58(堆出訊號)便會被送 出,此堆出訊號將起始一堆出/填入系統(詳述於後)。此 堆出/填入系統將會把一個或一個以上現存於主堆疊中最 舊的主框之元素,由主堆疊41送至次堆壘42。如此_ 來’元件將被存入次堆疊中。此堆出/填入系統將在背景 中繼續執行,直到主堆疊41中暫存器的使用量低於過溢 界.限值為止。 同樣的,當主堆疊41的使用小於或等於不足界限值 時’系統會送出一填入訊號59,堆出/填入系統接收到此 -16 - 本紙張尺度逋用中國國家標準(CNS ) Α4規格(210X297公釐) " "~~' ----------S.装-- (請先W讀背面之注意事項再填寫本頁) 訂 A7 B7Printed by the Consumer Cooperatives of the Central Commission of the Ministry of Economic Affairs V. Invention Description (丨 Multiple): It may be located at the top of the under stack 42 (for example: main frame X), which may be due to the overflow or insufficient of the main stack 41 , Caused by the resulting pile / fill (spill / fill) action. Whenever there is data in the main frame stack, at least one main frame is stored in the main stack, so that the processor can quickly access the data. In the traditional stack, 'the program will stop executing when it overflows or underruns', and the processor needs to deal with the stack overflow or underruns. The present invention can overcome this shortcoming, and does not need to temporarily stop the normal execution program of the system processor when processing the stack overflow or shortage. Fig. 5 is an overflow / underrun detection circuit 50 of the present invention. A limit ^ 51 is defined according to the requirements of the system. The limit table 51 may store one or more sets of overrun and underrun limit values. Overflow and underrun thresholds are used to determine whether register stacks', such as the main stack 41 in Figure 4, are overrun or underrun. Part of the main frame of the current activity record (for example, the part of the main frame last stored in the main frame stack) should be placed in the main stack. In order to ensure this, the undercutting value should be chosen to be equal to or greater than the size of the current activity record. The limit selector 52 is used to select an overflow and underlimit value. With the execution of the program, the limit selector 52 will dynamically select the overflow and underlimit value. The selection method will be based on, for example, the number of subroutine calls / returns. Or frequency 'rate and other program execution characteristics "For example,' if the current insufficient limit value is smaller than the current main frame size ', the limit selector 52 will select a new insufficient limit value from the limit table 51. The selected limit values are placed in the overflow limit register || 53 and the under limit register 54 respectively. ___-15-Fix the household standard rate from CNS (CNS > Μ Secret (2! 〇x 297 male thin) (Please read the notes on the back before filling in this X) ------ (Install ----- --- Light--r Λ Printed by the Consumer Cooperatives of the Central Standards Bureau of the Ministry of Economic Affairs A7 _____ B7 V. Description of the invention (丨 points) Stack top (TOS) register 55 (will be detailed in the following paragraph), pointing to the main stack Subjected to the most temporary location of 1§ (for example: the end of a data element) β and the bottom of stack (BOS) register 56 points to the oldest element in the main stack (for example: part of the main frame, part of the main frame One character, etc.), the number of registers from the value of Tos to the value of BOS is equal to the number of registers used in the current main stack 41. In a preferred embodiment of the present invention, the main stack (See Figure 4). Therefore, the usage of the main stack 41 can be calculated using the TOS value and the BOS value. In one embodiment of the present invention, the TOS value can be K + 1 bits, where The MSB bit is T, while the other bits (LSBs) are TOS values. The BOS value can be K + 1 bits, where the MSB bit is '0' and the other bits (lsBs) are 305. Value The overflow / underrun detection circuit 50 generates a data control signal to indicate whether it needs to be stacked from the main stack or to be filled in the sub-stack. In particular, when the use of the main stack 41 exceeds the overflow limit register, When the overflow limit value in 53 is reached, a background signal 58 (stacking signal) will be sent, and this stacking signal will start a stacking / filling system (detailed later). This stacking / filling The system will send one or more elements existing in the oldest primary frame in the primary stack from the primary stack 41 to the secondary stack barrier 42. In this way, the component will be stored in the secondary stack. This stack out / fill The input system will continue to be executed in the background until the use of the scratchpad in the main stack 41 is below the overflow limit. Similarly, when the use of the main stack 41 is less than or equal to the insufficient limit value, the system will send out A filling signal 59 is received by the stacking / filling system. -16-This paper size adopts the Chinese National Standard (CNS) A4 specification (210X297 mm) " " ~~ '------- --- S. Loading-- (Please read the precautions on the back before filling this page) Order A7 B7
五、發明説明(K 填入訊號時,將會取出次堆疊内一主框之一個或一個以 上的元素。這些被取出之主框元素會由次堆疊42送至多 堆疊41底部’直到主堆疊41中暫存器的使用量高過不足 界限值為止。 圖六係本發明一電路實施例,此電路將一主堆疊71與 一管線處理系統連結。在此實施例中有兩系統可存取支· 堆疊71,一管線中央控制單元(cpu,未顯示於圖中)可使 用一管線位址匯流排72及一管線資料匯流排73來存取美 堆疊71。以加速管線CPU對主堆疊71的存取,主堆疊71 可用一多琿暫存器記憶體來實踐。在一實施例中,主雉 疊71可有兩讀取埠和一寫入埠。如此則在一計算運# 時,可允許同時由主堆疊71取出兩元素,且允許寫入〆 計算結果》 經濟部中央橾準局員工消費合作社印^V. Description of the Invention (When K is filled in the signal, one or more elements of a main frame in the sub-stack will be taken out. These removed main frame elements will be sent from the sub-stack 42 to the bottom of the multi-stack 41 'until the main stack 41 The use amount of the intermediate register is higher than the insufficient limit value. Fig. 6 is a circuit embodiment of the present invention. This circuit connects a main stack 71 to a pipeline processing system. In this embodiment, two systems can access the support. · Stack 71, a pipeline central control unit (cpu, not shown in the figure) can use a pipeline address bus 72 and a pipeline data bus 73 to access the US stack 71. To accelerate the pipeline CPU to the main stack 71 For access, the main stack 71 can be implemented with a multi-register memory. In one embodiment, the main stack 71 can have two read ports and one write port. In this way, when calculating It is allowed to take out two elements from the main stack 71 at the same time, and it is allowed to write the calculation result.
—•m In «in —^^1 m tm \g〆 - - - nn /-4¾ π#先喊请贫韵M法意#承^决疼本'iaO 本發明之堆壘管理單元74如圖六所示,堆疊管理單元 74控制著主堆壘71與次堆疊75間之一主框、部分主框、 主框中元素等等的傳輸。管線CPU和堆疊管理單元74透 過一位址互聯網路(address interconnection network) (ICN) 76來傳送位址給主堆疊71。主堆疊71與次堆疊75間透過 一主框互聯網路77相互傳輸,且管線CPU亦經由此主框 互聯網路77將資料取出或存入主堆疊71。 圖七為一具本發明之堆疊管理單元的管線處理系統。 如圖所示,一主框堆疊包含一主堆疊81和一次堆疊82, 而由一堆出/填入偵測單元8 3及一堆出/填入控制系統8 4來 控制主堆疊81和次堆疊82間的傳輸。 17 - 表紙張歧適用中國固家揉準(CNS) Α4· (2敝297公瘦 經濟部中央標準局員工消費合作社印製 A7 _B7 五、發明説明(k ) 在運作時,處理系統依據現行系統資源使用量發出一 控制訊號86,控制單元85接收到此控制訊號86後,便透 過緩衝器88傳送一訊號87給界限選擇器92作為回應。同 時,此緩衝器亦經由一匯流排90接收到從控制暫存器(未 圖示)來的一同步訊號89,界限選擇器92並傳送過溢/不足 界限值93給堆出/填入偵測單元83。 再者’一 TOS暫存器96和一 B〇s暫存器97分別將一 TOS訊號94和一BOS訊號95送給堆出/填入谓測單元。一 連結(link)暫存器101負責維護最後儲存於次堆叠中之元 素的位址,TOS暫存器96中所含為主堆疊之T〇s的位 址,一BOS暫存器97中所含則為目前在主堆疊中最舊之 主框的開始位址〇 現在主堆疊81所使用的暫存器數目可藉由將B〇s減去 TOS而決定’當暫存器使用數目超出過溢界限值或是低 於不足界限值時,堆出/填入控制系統84傳送一主堆疊控 制訊號98給主堆疊81。同時,堆出/填入控制系統亦傳 送一次堆疊控制訊號99給次堆疊82。 元素等,譬如說’會在主堆疊81和次堆疊82間相互傳 送,以回應主堆疊控制訊號98和次堆疊控制訊號99 »而 當一過溢/不足被偵測出時,堆出/壤入裝置所傳輸之資料 、 多寡並非定量,例如,一次可傳送一、二、四個字元等 等(2n字元)。在本發明之一實施例中,系統可支援大量 傳輸模式來傳送二個字元以上。 -18 - 本紙張尺度適用CNS )八4祕(210X297公釐) .衣-- (請先閲讀背面之注意事項再填寫本頁) *1Τ· 五、發明説明(Η ) -次傳送-個以上字元可降低傳輪時間,並且能利用 更多傳輸寬度以完成傳輪一次傳送—個字元是最為保 守的做法’ t也使収多傳輸指令以完成堆姆入之運 作<3實際上取佳的傳輪值可經由軟體模擬來決定,而傳 輸的數目亦會影響連結暫存器1〇1的大小。 在-4-位元組字讀㈣·位元來定址之主框堆叠架 構中’ 一個一次堆出/填入—個字元的系統可使用一3卜位 元連結暫存益,以能提供主堆疊和次堆疊一4_位元組排 準(alignment) ^而一個一次堆出/填入二個字元的系統可 使用一 29-位元連結暫存器,以能提供8_位元組排準 (alignment)。而一個一次堆出/填入四個字元的系統可使 用一 28-位元連結暫存器,以能提供16_位元組排準 (alignment)、等等。 經濟部中央棵準局貝工消費合作社印装 ^ ^-- (請先Μ讀背面之注意事項再填寫本頁) 在一處理過溢情況的系統中,主堆疊堆出^字元(例 如· 2n字元)’處於BOS至BOS + L— 1位址的字元皆被搬 給次堆疊’且BOS暫存器内之位址成為b〇S + L。而在不 足的情況時,主堆疊自次堆疊填入L字元,這些字元被填 入主堆疊位址B0S—1至BOS —L,而BOS暫存器内之位 址則成為BOS —L。 在一堆出/填入運作中,主堆疊81自一 BOS暫存器97 、 接收一BOS訊號,而此堆疊自連結暫存器1〇1接收一用來 作堆出/填入運作資料指標的連結訊號,這些訊號指引著 主堆疊81和次堆疊82間之一 _叫/返回運作。 -19 - (CNS ) A4ijys· ( 210X297公釐) I > A7 經濟部中央標準局員工消費合作社印製 B7五、發明説明(ίδ) 本發明所揭露之堆疊管理單元將處理系統的多個堆疊 合併成一主框堆疊,此主框堆疊可用單一堆疊管理單元 來管理,因此降低處理堆疊元素的時間,而增進處理系 統整體效能。並且本發明以一堆出/填入背景程序來處理 堆疊過溢/不足,故而在處理堆疊過溢/不足時並不需要將 處理機停止下來,因此更進一步的提高系統效能。 本發明雖以一較佳實施例揭露如上,然其並非用以限 定本發明,任何熟習此技藝者,在不脫離本發明之精神 和範圍内,當可做些許的更動與潤飾,而皆不脫離本發 明之申請專利範圍。 ---------f 装II (請先閔讀背面之注意事項再填寫本頁) 訂 20 本紙張尺度適用t國國家標準(CNS ) Α·4規格(210X297公釐)— • m In «in — ^^ 1 m tm \ g〆---nn / -4¾ π # First call please poor rhyme M 法 意 # 承 ^ 定 痛 本 'iaO The stack management unit 74 of the present invention is shown in the figure As shown in FIG. 6, the stack management unit 74 controls the transmission of one of the main frame, part of the main frame, and elements in the main frame between the main stack barrier 71 and the sub-stack 75. The pipeline CPU and the stack management unit 74 transmit an address to the main stack 71 through an address interconnection network (ICN) 76. The main stack 71 and the sub-stack 75 are transmitted to each other through a main frame internet path 77, and the pipeline CPU also fetches or stores data into the main stack 71 via this main frame internet path 77. FIG. 7 is a pipeline processing system with a stack management unit according to the present invention. As shown in the figure, a main frame stack includes a main stack 81 and a primary stack 82, and a stack out / fill detection unit 8 3 and a stack out / fill control system 84 control the main stack 81 and the secondary stack. Transmission between stacks 82. 17-Sheets and papers are applicable to China's Gujiazheng Standard (CNS) Α4 · (2 敝 297 printed by the Consumers' Cooperative of the Central Standards Bureau of the Ministry of Economic Affairs of the People's Republic of China) A7 _B7 V. Description of Invention (k) In operation, the processing system is based on the current system The resource usage sends out a control signal 86. After receiving the control signal 86, the control unit 85 sends a signal 87 to the limit selector 92 through the buffer 88 as a response. At the same time, the buffer is also received via a bus 90 A synchronization signal 89 from the control register (not shown), the limit selector 92 and the over / under limit value 93 are transmitted to the stacking / filling detection unit 83. Furthermore, a 'TOS register 96 And a B0s register 97 send a TOS signal 94 and a BOS signal 95 to the stacking / filling unit respectively. A link register 101 is responsible for maintaining the last element stored in the sub-stack The address of TOs contained in the TOS register 96 in the main stack, and the start address of the oldest main frame currently in the main stack in the BOS register 97. Now The number of registers used in the main stack 81 can be determined by subtracting TOS from B0s When the number of temporary registers exceeds the overflow threshold or falls below the threshold, the stack / fill control system 84 sends a main stack control signal 98 to the main stack 81. At the same time, the stack / fill control system also Send a primary stack control signal 99 to the secondary stack 82. Elements such as' will be transmitted between the primary stack 81 and the secondary stack 82 in response to the primary stack control signal 98 and the secondary stack control signal 99 »and when an overflow / When the shortage is detected, the amount of data transmitted by the stacking / injecting device is not quantitative, for example, one, two, four characters, etc. (2n characters) can be transmitted at one time. In one embodiment of the present invention In the system, the system can support a large number of transmission modes to transmit more than two characters. -18-This paper size is suitable for CNS) 8 secrets (210X297 mm). Clothing-(Please read the precautions on the back before filling this page) * 1T. V. Description of the Invention (Η)-Multiple transmissions-more characters can reduce the transmission time, and can use more transmission width to complete the transmission of one transmission-one character is the most conservative way. Receive multiple transfer instructions to complete the stack Operation as < 3 effectively takes the rotating excellent transmission may be determined via simulation software, and the number of transmission links will also affect the size of the register 1〇1. In the main frame stacking architecture where 4-byte characters are read and bits are used for addressing, 'One-time stacking / filling-in one character system can use a 3-bit byte to link temporary storage benefits to provide Primary stack and secondary stack-4_byte alignment ^ and a system that stacks / fills 2 characters at a time can use a 29-bit link register to provide 8_bits Group alignment. A system that stacks / fills four characters at a time can use a 28-bit link register to provide 16-bit alignment, and so on. Printed by the Central Workers' Bureau of the Ministry of Economic Affairs, Shellfish Consumer Cooperatives ^ ^-(Please read the precautions on the back before filling out this page) In a system that handles overflow conditions, the main stack piles up ^ characters (for example, · 2n characters) 'All characters at addresses BOS to BOS + L-1 are moved to the secondary stack' and the address in the BOS register becomes bOS + L. In the case of shortage, the main stack is filled with L characters from the secondary stack. These characters are filled in the main stack addresses B0S-1 to BOS-L, and the address in the BOS register becomes BOS-L. . In a pile-out / fill-in operation, the main stack 81 receives a BOS signal from a BOS register 97, and the stack receives one from the link register 101 for stacking / filling operation data indicators. These signals direct one of the main stack 81 and the secondary stack 82 to call / return. -19-(CNS) A4ijys · (210X297mm) I > A7 Printed by the Consumers' Cooperative of the Central Standards Bureau of the Ministry of Economic Affairs B7 V. Description of the Invention (δ) The stack management unit disclosed in the present invention will process multiple stacks of the system Combined into a main frame stack. This main frame stack can be managed by a single stack management unit, thus reducing the time to process stack elements and improving the overall performance of the processing system. In addition, the present invention uses a stack of background programs to process stack overflow / underfill. Therefore, it is not necessary to stop the processor when processing stack overflow / underfill, so the system efficiency is further improved. Although the present invention is disclosed as above with a preferred embodiment, it is not intended to limit the present invention. Any person skilled in the art can make some modifications and decorations without departing from the spirit and scope of the present invention. Depart from the patentable scope of the invention. --------- f Pack II (please read the notes on the back before filling this page) Order 20 This paper size is applicable to National Standards (CNS) Α · 4 specifications (210X297 mm)
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW87112788A TW385399B (en) | 1998-08-04 | 1998-08-04 | A kind of management device and method for multi-stacks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW87112788A TW385399B (en) | 1998-08-04 | 1998-08-04 | A kind of management device and method for multi-stacks |
Publications (1)
Publication Number | Publication Date |
---|---|
TW385399B true TW385399B (en) | 2000-03-21 |
Family
ID=21630899
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW87112788A TW385399B (en) | 1998-08-04 | 1998-08-04 | A kind of management device and method for multi-stacks |
Country Status (1)
Country | Link |
---|---|
TW (1) | TW385399B (en) |
-
1998
- 1998-08-04 TW TW87112788A patent/TW385399B/en not_active IP Right Cessation
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101996098B (en) | Managing message queues | |
TWI228657B (en) | Virtual set cache that redirects store data to correct virtual set to avoid virtual set store miss penalty | |
CN107256196A (en) | The caching system and method for support zero-copy based on flash array | |
TW200525355A (en) | Microprocessor and apparatus for performing speculative load operation from a stack memory cache | |
CN108369562A (en) | Intelligently encoding memory architecture with enhanced access scheduling device | |
WO2021088404A1 (en) | Data processing method, apparatus and device, and readable storage medium | |
CN115168259B (en) | Data access method, device, equipment and computer readable storage medium | |
US10474575B2 (en) | Cache-based communication between execution threads of a data processing system | |
WO1998026352A1 (en) | Method of file pre-read control in computer system | |
TW385399B (en) | A kind of management device and method for multi-stacks | |
TWI295786B (en) | Apparatus and method for managing stack transfers in a register-based processor | |
KR100804107B1 (en) | Computer system | |
JP3190700B2 (en) | Address translator | |
TW399204B (en) | Synchronous dynamic random access memory architecture for sequential burst mode | |
JP3964821B2 (en) | Processor, cache system and cache memory | |
CA1116756A (en) | Cache memory command circuit | |
US6804754B1 (en) | Space management in compressed main memory | |
CN109426562A (en) | Priority weighted robin scheduling device | |
JP2685455B2 (en) | Data processing device | |
CN113126913A (en) | Data array management method and device based on parallel RAM and storage equipment | |
JPH04288638A (en) | Computer system | |
JPS6194159A (en) | Memory | |
CN104778131B (en) | A kind of data cache method and a kind of buffer storage | |
JP3745909B2 (en) | File management method | |
JP2615046B2 (en) | Record addition processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GD4A | Issue of patent certificate for granted invention patent | ||
MK4A | Expiration of patent term of an invention patent |