TWI760756B - 共用代碼之系統與代碼共用方法 - Google Patents

共用代碼之系統與代碼共用方法 Download PDF

Info

Publication number
TWI760756B
TWI760756B TW109117990A TW109117990A TWI760756B TW I760756 B TWI760756 B TW I760756B TW 109117990 A TW109117990 A TW 109117990A TW 109117990 A TW109117990 A TW 109117990A TW I760756 B TWI760756 B TW I760756B
Authority
TW
Taiwan
Prior art keywords
processor
shared
code
memory
subsection
Prior art date
Application number
TW109117990A
Other languages
English (en)
Other versions
TW202119215A (zh
Inventor
馮嘯慈
張家維
姚立三
Original Assignee
聯發科技股份有限公司
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 聯發科技股份有限公司 filed Critical 聯發科技股份有限公司
Publication of TW202119215A publication Critical patent/TW202119215A/zh
Application granted granted Critical
Publication of TWI760756B publication Critical patent/TWI760756B/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • G06F15/17306Intercommunication techniques
    • G06F15/17331Distributed shared memory [DSM], e.g. remote direct memory access [RDMA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/0284Multiple user address space allocation, e.g. using different base addresses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/0292User address space allocation, e.g. contiguous or non contiguous base addressing using tables or multilevel address translation means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0875Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0626Reducing size or complexity of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1004Compatibility, e.g. with legacy hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/45Caching of specific data in cache memory
    • G06F2212/452Instruction code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44557Code layout in executable memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44557Code layout in executable memory
    • G06F9/44563Sharing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Advance Control (AREA)
  • Orthopedics, Nursing, And Contraception (AREA)

Abstract

本發明提供一種共用代碼之系統與代碼共用方法。該系統包含記憶體與複數個處理器。該記憶體進一步包含共用區段與非共用區段。該複數個處理器至少包含第一處理器與第二處理器,該第一處理器與該第二處理器具有該記憶體之該共用區段之唯讀接入許可權。該第一處理器與該第二處理器分別執行該記憶體之該共用區段中存儲之共用代碼,並且分別執行該非共用區段之第一子區段與第二子區段中存儲之非共用代碼。該第一處理器與該第二處理器分別依據第一排程器與第二排程器,執行共用代碼。該第一排程器獨立於該第二排程器工作。本發明提供之共用代碼之系統與代碼共用方法可節省成本。

Description

共用代碼之系統與代碼共用方法
本發明總體上有關於系統處理,以及更具體地,有關於一種具有對至少一部分記憶體子系統共用接入之多處理器計算系統。
現代計算系統通常具有複數個處理器,每個處理器具有其自身專用記憶體。由於有限形態因素,行動裝置系統(例如,智慧手機)通常為其使用者提供有限記憶體容量。隨著多媒體內容之存儲需求增長,記憶體容量方面也存在增長之需求。由於漏電流,增長之記憶體容量導致功耗增大,另外由於更高之門數,成本也相應增高。因此,在不向系統增加更多記憶體情況下有效利用現存記憶體容量可顯著改善系統之性能與成本。
對於有效記憶體使用,已經提出了複數個方法。然而,特別地對於記憶體受限多處理器系統需要設計策略。
在實施例中,提供一種共用代碼之系統。該系統包含記憶體與複數個處理器。該記憶體進一步包含共用區段(section)與非共用區段。該複數個處理器至少包含第一處理器與第二處理器,該第一處理器與該第二處理器具有該記憶體之該共用區段之唯讀接入許可權。該第一處理器與該第二處理器分別 執行該記憶體之該共用區段中存儲之共用代碼,並且分別執行該非共用區段之第一子區段與第二子區段中存儲之非共用代碼。該第一處理器與該第二處理器分別依據第一排程器與第二排程器,執行共用代碼。該第一排程器獨立於該第二排程器工作。
在另一實施例中,提供一種複數個處理器中代碼共用方法。該方法包含:將共用代碼存儲在記憶體之共用區段並且將非共用代碼存儲在該記憶體之非共用區段;由第一處理器依據第一排程器執行該共用區段中之該共用代碼;以及由第二處理器依據第二排程器執行該共用區段中之該共用代碼。該第一處理器與該第二處理器具有該共用區段之唯讀接入許可權,並且該第二排程器獨立於該第一排程器工作。
本發明提供之共用代碼之系統與代碼共用方法可節省成本。
其它實施方式和優點在下面之詳細描述中描述。該發明內容並不打算限定本發明。本發明由申請專利範圍限定。
100:系統
110:第一處理器
120:第二處理器
130:匯流排
140:記憶體
115、125:排程器
117:第一發佈電路
127:第二發佈電路
111、121:I快取記憶體
113、123:D快取記憶體
141:通用代碼區域
142:通用唯讀資料區域
143:第一代碼區域
144:第一讀寫資料區域
145:第二代碼區域
146:第二RW資料區域
250:硬體電路
300:方法
310、320、330:步驟
400:行動裝置
410:處理電路
415:處理器
420:記憶體
422:共用區段
423:非共用區段
430:I/O電路
450:無線通訊電路
490:電池
附圖說明透過示例而非限制的方式描述本發明,其中,相同的附圖標記標識相似元件。應當注意的是,本發明中對一個實施例的不同參考並不一定是相同實施例,並且這種參考意味著至少一個。此外,當結合實施例描述特定特徵、結構或特性時,無論是否明確描述,主張本領域技術人員獲知結合其他實施例的該特徵、結構或特性。
第1圖描述了本發明實施例可工作之系統。
第2圖是依據實施例描述了位址映射或重定向之示意圖。
第3圖是依據實施例描述了代碼共用方法之流程圖。
第4圖依據實施例描述了行動裝置示例。
在此揭示本發明之詳細實施例。然而,可以理解的是,本實施例僅是為了描述本發明之各種形式。然而,本發明可以各種不同形式進行呈現,並不一定限定於本發明所述實施例。提供這些實施例是為了本發明描述更徹底完整,並向本領域技術人員全面表述本發明範圍。在接下來描述中,將忽略已知特徵與技術,從而避免對本發明實施例描述之不必要干擾。
本發明實施例提供了複數個處理器接入之記憶體中共用可執行代碼之系統與方法。也可在處理器之間共用記憶體中唯讀資料。處理器依據其各自獨立排程器執行指令。在不將共用代碼複製入記憶體之處理器各自非共用子區段(section)情況下,處理器執行該共用代碼。因此,可顯著降低共用代碼與資料佔用之記憶體數量,並且由此降低了裝置中記憶體容量需求。裝置中記憶體數量直接正比於裝置之門數、漏電流與成本。同樣地,這裡描述之代碼與資料共用可提高記憶體之有效使用率,並且因此可改善包含記憶體之裝置之性能與成本。
第1圖是依據實施例描述了系統100之區塊圖。系統100包含兩個或複數個處理器,例如,第一處理器110與第二處理器120。在許多實施例中,可將處理器稱為處理器核心、微處理器、核心、多核心處理器、計算單元、執行單元、處理電路等。接下來之描述使用兩個處理器作為示例;然而,可以理解的是,將該描述應用於共用接入相同記憶體之多於兩個處理器。
第一處理器110與第二處理器120可具有相同或相容之指令集結構(Instruction Set Architecture,ISA),其使得處理器能執行來自相同或相容之指令集之指令。在許多實施例中,在相同或相容ISA實施中,處理器110與120可具 有不同微結構。相容ISA之示例可包含相同處理器結構序列(例如,RISC-V®序列、Arm®序列、MIPS®序列或其他處理器結構序列)之ISA。
在實施例中,分別依據排程器115與125排程之任務,第一處理器110與第二處理器120執行指令。任務包含指令集。排程器115與125彼此獨立工作;例如,排程器115與125可將不同任務安排至各個處理器,以在給定時間中執行。當準備執行指令時,可發佈已排程指令。第一處理器110與第二處理器120也包含各自發佈電路(即,第一發佈電路117與第二發佈電路127)。第一發佈電路117與第二發佈電路127也彼此獨立工作。此外,處理器110與120獨立工作;更特別地,通過從各個排程器115與125以及各個發佈電路117與127接收任務與指令。處理器110與120不從集中任務排程器及/或集中指令發佈電路接收任務或指令。換句話說,處理器110與120可彼此獨立執行指令(例如,使用者與作業系統指令)。
第一處理器110與第二處理器120之每一個耦接至快取記憶體集(a set of cache memory),例如,指令快取記憶體(I快取記憶體111或121)與資料快取記憶體(D快取記憶體113或123)。可使用快取記憶體存儲預取指令與頻繁使用資料,以降低接入記憶體140之延遲。在實施例中,I快取記憶體111與121可存儲預計重複執行之指令,例如,當型迴圈(while-loop)中之指令。在實施例中,第一處理器110、第二處理器120以及它們各自快取記憶體可為片上系統(SoC)平臺之一部分。在實施例中,SoC平臺可為行動計算及/或通信裝置、臺式計算系統、伺服器計算系統、雲計算系統等之一部分。
在實施例中,第一處理器110與第二處理器120共用接入記憶體140。記憶體140可為系統100之系統記憶體或主記憶體。記憶體140可包含隨機接入記憶體(RAM)裝置,例如,動態隨機接入記憶體(DRAM)裝置、快閃記憶體裝置及/或其他易失性或非易失性記憶體裝置。記憶體140也可包含用於存 儲唯讀資料或唯讀代碼(例如,共用代碼)之唯讀記憶體(ROM)。第一處理器110與第二處理器120可經由本地匯流排130或另一類型連接,接入記憶體140。
在實施例中,記憶體140包含共用區段與非共用區段。例如,共用區段可包含通用代碼區域141與通用唯讀(RO)資料區域142。共用區段是防寫之(例如,唯讀)以確保資料完整性。可將非共用區段分割為複數個子區段,其中,將每個子區段分配至一個處理器。例如,為第一處理器110分配第一子區段,該第一子區段包含第一代碼區域143與第一讀寫(RW)資料區域144。為第二處理器120分配第二子區段,該第二子區段包含第二代碼區域145與第二RW資料區域146。
通用代碼區域141存儲兩個或複數個處理器共用之程式。例如,複數個處理器可共用測量執行時間之程式。第一處理器110與第二處理器120彼此獨立執行通用代碼區域141中之共用代碼。在無需將共用程式副本保存在每個非共用子區段情況下,使用通用代碼區域141存儲共用程式可顯著節省記憶體140之存儲空間。相似地,通用RO資料區域142存儲兩個或複數個處理器共用之唯讀資料。例如,該共用資料可包含通用代碼區域141中存儲之共用程式所用之輸入參數。其他共用唯讀資料也可被存儲在通用RO資料區域142。通用RO資料區域142之使用也可顯著節省記憶體140之存儲空間。
在實施例中,處理器110與120可同時或不同時在程式執行期間讀取記憶體140之共用區段。可將執行結果寫入其各自非共用子區段。
通用代碼區域141存儲處理器110與120可執行之機器可執行指令。機器可執行指令可指定源運算元(例如,輸入資料)及/或目標運算元(例如,執行結果)。例如,可從記憶體140之共用區段中給定記憶體位址載入源運算元。在許多情況中,源運算元及/或目標運算元可位於記憶體140之非共用區段。在實施例中,當執行通用代碼區域410中指令時,可將相同記憶體位址或指 針提供給第一處理器110與第二處理器120。該記憶體位址或指針可指向僅第一處理器110接入第一RW資料區域144處之記憶體位置。在運行時,可將該記憶體位址或指針映射或重定向至僅第二處理器120接入第二RW資料區域146處之另一記憶體位置。軟體或硬體可執行該映射或重定向步驟,下面參考第2圖提供技術細節。
第2圖是依據實施例描述了處理器110與120執行之記憶體操作(例如,載入或存儲)之示意圖。當執行存儲在通用代碼區域141之指令時,處理器110與120可從記憶體140讀取資料,並且可生成寫回至記憶體140之執行結果。在實施例中,處理器110與120兩者可同時或不同時執行具有第一RW資料區域144中第一位址處運算元之讀/寫(例如,載入/存儲)指令。第一處理器110可在第一位址處讀或寫,另外第二處理器120可在映射至第一位址之第二位址處讀或寫。在實施例中,第二處理器120可在運行時執行由記憶體管理系統軟體指示之位址映射方法。在另一實施例中,為耦接記憶體140及/或第二處理器120之硬體電路250配置偏移值。當第二處理器120執行在第一位址處具有運算元之讀/寫指令時,硬體電路250將該偏移值加入第一位址,以生成在第二子區段處之第二位址,並且從第一位址至第二位址重定向第二處理器120之讀/寫操作。
在包含附加處理器(例如,大於兩個)之系統中,可為硬體電路250配置每個附加處理器之不同偏移值,從而使得也可將這些附加處理器之讀/寫接入重定向至記憶體140中各個非共用子區段。
第3圖依據實施例描述了代碼共用之方法300。第1圖之系統100及/或第4圖之行動裝置400,或者另一計算及/或通信裝置可執行方法300。在實施例中,執行方法300之裝置包含存儲指令之電路(例如,處理硬體)與電腦可讀介質(例如,記憶體),其中,當執行該指令時會引起裝置執行方法300。
參考第3圖,在實施例中,方法300開始於步驟310,將共用代碼存 儲在記憶體之共用區段,並且將非共用代碼存儲在記憶體之非共用區段。在步驟320,第一處理器依據第一排程器執行共用區段中之共用代碼。在步驟330,第二處理器依據第二排程器執行共用區段中之共用代碼。第一處理器與第二處理器對共用區段具有唯讀接入許可權。第二排程器獨立於第一排程器工作。
在實施例中,裝置100及/或行動裝置400可包含兩個或複數個處理器共用記憶體共用區段中之可執行代碼,而不用將共用代碼複製至其各自非共用子區段。在依據共用代碼之實施例中,第一處理器與第二處理器可執行具有第一子區段中第一位址處運算元之讀/寫指令,並且在運行時,第二處理器可依據位址映射方法將第一位址映射至第二子區段之第二位址。在另一實施例中,在運行時,硬體電路可將第二處理器執行之讀/寫操作從第一子區段中第一位址重定向至第二子區段中第二位址。在實施例中,第一處理器與第二處理器也可共用記憶體共用區段中存儲之唯讀資料。
第4圖依據實施例描述了行動裝置400之示例。行動裝置400可為第1圖之裝置100之示例,其提供用於上述視頻記錄之平臺。行動裝置400包含處理電路410,其進一步包含處理器415(例如,中央處理單元)、影像處理單元(GPU)、數位訊號處理單元(DSP)、多媒體處理器、其他通用及/或專用處理電路。在許多系統中,處理器415可與「核心」或「處理器核心」相同,另外在許多其他系統中,處理器可包含複數個核心。每個處理器415可包含算數邏輯單元(ALU)、控制電路、快取記憶體以及其他硬體電路。在實施例中,處理電路410工作以執行行動裝置400上運行之軟體(包含前述記憶體管理系統軟體)與應用。在實施例中,行動裝置400工作以執行第3圖之方法300。
行動裝置400進一步包含耦接至處理電路410之記憶體420。記憶體420包含類似於共用區段422與非共用區段423之分區。記憶體420可包含記憶體裝置,例如,動態RAM裝置、ROM裝置、快閃記憶體及/或其他易失性或非易失 性記憶體裝置。記憶體420可進一步包含存儲裝置,例如,任意類型固態或磁性存儲裝置。在實施例中,記憶體420可為行動裝置400之主記憶體或系統記憶體。
行動裝置400也可包含I/O電路430,以接收輸入並顯示輸出。I/O電路430可進一步包含無線通訊電路450,例如,天線、數位及/或邏輯射頻(RF)收發器與RF電路。行動裝置400可進一步包含電池490,以向行動裝置400之硬體元件供電。
可以理解的是,為了描述目的,簡化了第3圖之實施例。可增加附加硬體元件,並且可忽略第4圖所示之許多元件。
雖然本發明中使用行動裝置400作為示例,但是可以理解的是可將本發明中之方法應用於包含複數個處理器之任意計算及/或通信裝置。行動裝置400之無限制示例包含智慧手機、智慧手錶、可穿戴裝置、平板電腦、網路連接裝置、遊戲裝置、導航裝置、物聯網(IoT)裝置、影像處理裝置、資訊娛樂裝置、閱讀器裝置以及其他可攜帶及/或可穿戴電子裝置。
已經參考第1圖與第4圖之實施例描述了第3圖之流程圖操作。然而,應當理解之是,不同於第1圖與第4圖所討論實施例之其他本發明實施例可執行第3圖之流程圖操作,並且第1圖與第4圖所討論實施例可執行不同於流程圖中所討論之步驟。雖然第3圖之流程圖顯示本發明特定實施例執行操作之特定順序,但應該理解的是,該順序是示例性之(例如,替換實施例可按照不同循序執行操作、組合特定操作、重迭特定操作等)。
上述已經描述了各種功能元件或區塊。本領域技術人員可知,上述功能模組可通過電路(在一個或複數個處理器以及代碼指令控制下進行操作之專用電路、通用電路)進行實施,上述電路一般包含電晶體,其可依上述方式進行配置依據上述功能與操作控制電路運行。
雖然已經透過示例並且按照優選實施方式描述了本發明,但是要 理解之是,本發明不限於此。熟悉該技術之人仍然能夠在不脫離本發明之範圍與精神之情況下進行各種變更與修改。因此,本發明之範圍應當由所附之申請專利範圍及其等同物限定與保護。
100:系統
110:第一處理器
120:第二處理器
130:匯流排
140:記憶體
115、125:排程器
117:第一發佈電路
127:第二發佈電路
111、121:I快取記憶體
113、123:D快取記憶體
141:通用代碼區域
142:通用唯讀資料區域
143:第一代碼區域
144:第一讀寫資料區域
145:第二代碼區域
146:第二RW資料區域

Claims (9)

  1. 一種共用代碼之系統,包含:記憶體,包含共用區段與非共用區段;以及複數個處理器,至少包含第一處理器與第二處理器,該第一處理器與該第二處理器具有該記憶體之該共用區段之唯讀接入許可權,其中,該第一處理器與該第二處理器執行下列步驟:分別依據第一排程器與第二排程器,執行該記憶體之該共用區段中存儲之共用代碼,其中,該第一排程器獨立於該第二排程器工作,分別執行該非共用區段之第一子區段與第二子區段中存儲之非共用代碼,以及配置該第一處理器與該第二處理器依據該共用代碼執行在該第一子區段中第一位址處具有運算元之讀或寫指令,並且對於接入該運算元,在運行時,該第二處理器依據位址映射方法將該第一位址映射至該第二子區段中第二位址。
  2. 如申請專利範圍第1項所述之共用代碼之系統,其中,進一步配置該第一處理器與該第二處理器分別將執行該共用代碼之各自結果寫入該第一子區段與該第二子區段中。
  3. 如申請專利範圍第1項所述之共用代碼之系統,其中,該系統進一步包含硬體電路,其中,在運行時,該硬體電路將該第二處理器執行之讀或寫操作從該第一子區段中該第一位址處重定向至該第二子區段中該第二位址。
  4. 如申請專利範圍第1項所述之共用代碼之系統,其中,進一步配置該第一處理器與該第二處理器同時接入該記憶體之該共用區段。
  5. 如申請專利範圍第1項所述之共用代碼之系統,其中,配置該第一處理器與該第二處理器共用該記憶體之該共用區段中存儲之唯讀資料。
  6. 如申請專利範圍第1項所述之共用代碼之系統,其中,該第一處 理器與該第二處理器彼此獨立執行該共用代碼。
  7. 如申請專利範圍第1項所述之共用代碼之系統,其中,該第一處理器與該第二處理器具有相同或相容指令集結構。
  8. 如申請專利範圍第1項所述之共用代碼之系統,其中,配置該第一處理器與該第二處理器在無需該非共用區段中該共用代碼之副本情況下,執行該共用區段中存儲之該共用代碼。
  9. 一種代碼共用方法,包含:將共用代碼存儲在記憶體之共用區段並且將非共用代碼存儲在該記憶體之非共用區段,其中該非共用區段包括第一子區段以及第二子區段;由第一處理器依據第一排程器執行該共用區段中之該共用代碼以及該非共用區段之該第一子區段中之非共用代碼;由第二處理器依據第二排程器執行該共用區段中之該共用代碼以及該非共用區段之該第二子區段中之非共用代碼;由該第一處理器和該第二處理器依據該共用代碼執行在該第一子區段中第一位址處具有運算元之讀或寫指令;以及在運行時,該第二處理器依據位址映射方法將該第一位址映射至該第二子區段中第二位址,以及接入該運算元;其中,該第一處理器與該第二處理器具有該共用區段之唯讀接入許可權,並且該第二排程器獨立於該第一排程器工作。
TW109117990A 2019-11-05 2020-05-29 共用代碼之系統與代碼共用方法 TWI760756B (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US16/675,212 2019-11-05
US16/675,212 US11144322B2 (en) 2019-11-05 2019-11-05 Code and data sharing among multiple independent processors

Publications (2)

Publication Number Publication Date
TW202119215A TW202119215A (zh) 2021-05-16
TWI760756B true TWI760756B (zh) 2022-04-11

Family

ID=75689002

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109117990A TWI760756B (zh) 2019-11-05 2020-05-29 共用代碼之系統與代碼共用方法

Country Status (3)

Country Link
US (2) US11144322B2 (zh)
CN (1) CN112783823A (zh)
TW (1) TWI760756B (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI826252B (zh) * 2022-12-21 2023-12-11 瑞昱半導體股份有限公司 在多個處理器之間共用儲存裝置的方法以及電子裝置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6813522B1 (en) * 2000-12-29 2004-11-02 Emc Corporation Method of sharing memory in a multi-processor system including a cloning of code and data
TWI227401B (en) * 2001-03-22 2005-02-01 Sony Computer Entertainment Inc Method and system for establishing a temporary, dedicated pipeline in a processor apparatus for processing data being received by said processing apparatus
CN101308462A (zh) * 2007-05-14 2008-11-19 国际商业机器公司 管理对共享存储器单元的存储器访问的方法和计算***
US20100023703A1 (en) * 2008-07-28 2010-01-28 Christie David S Hardware transactional memory support for protected and unprotected shared-memory accesses in a speculative section
US7809896B2 (en) * 2004-04-29 2010-10-05 International Business Machines Corporation Efficient sharing of memory between applications running under different operating systems on a shared hardware system
CN104050095A (zh) * 2013-03-14 2014-09-17 索尼公司 缓存控制装置、处理器、信息处理***和缓存控制方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7158995B2 (en) * 2002-05-08 2007-01-02 Oracle International Corporation Method for managing pointers to external objects in a run-time environment
US8812796B2 (en) * 2009-06-26 2014-08-19 Microsoft Corporation Private memory regions and coherence optimizations
US10198358B2 (en) * 2014-04-02 2019-02-05 Advanced Micro Devices, Inc. System and method of testing processor units using cache resident testing
US20180165133A1 (en) * 2016-12-13 2018-06-14 Microsoft Technology Licensing, Llc Shared Memory Using Memory Mapped Files Between Host And Guest On A Computing Device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6813522B1 (en) * 2000-12-29 2004-11-02 Emc Corporation Method of sharing memory in a multi-processor system including a cloning of code and data
TWI227401B (en) * 2001-03-22 2005-02-01 Sony Computer Entertainment Inc Method and system for establishing a temporary, dedicated pipeline in a processor apparatus for processing data being received by said processing apparatus
US7809896B2 (en) * 2004-04-29 2010-10-05 International Business Machines Corporation Efficient sharing of memory between applications running under different operating systems on a shared hardware system
CN101308462A (zh) * 2007-05-14 2008-11-19 国际商业机器公司 管理对共享存储器单元的存储器访问的方法和计算***
US20100023703A1 (en) * 2008-07-28 2010-01-28 Christie David S Hardware transactional memory support for protected and unprotected shared-memory accesses in a speculative section
CN104050095A (zh) * 2013-03-14 2014-09-17 索尼公司 缓存控制装置、处理器、信息处理***和缓存控制方法

Also Published As

Publication number Publication date
US20230342155A1 (en) 2023-10-26
CN112783823A (zh) 2021-05-11
US11144322B2 (en) 2021-10-12
US20210132952A1 (en) 2021-05-06
TW202119215A (zh) 2021-05-16

Similar Documents

Publication Publication Date Title
US10228861B2 (en) Common platform for one-level memory architecture and two-level memory architecture
EP2962198B1 (en) Executing an operating system on processors having different instruction set architectures
US8200949B1 (en) Policy based allocation of register file cache to threads in multi-threaded processor
US7805582B2 (en) Method of managing memory in multiprocessor system on chip
US9779469B2 (en) Register spill management for general purpose registers (GPRs)
KR20170027125A (ko) 컴퓨팅 시스템 및 컴퓨팅 시스템에서 연산들을 처리하는 방법
US10565131B2 (en) Main memory including hardware accelerator and method of operating the same
US20170371654A1 (en) System and method for using virtual vector register files
US9329865B2 (en) Context control and parameter passing within microcode based instruction routines
KR20180034440A (ko) 효율적인 병렬 컴퓨팅을 위한 단순화된 태스크-기반 런타임을 위한 방법
KR20240004361A (ko) 프로세싱-인-메모리 동시적 프로세싱 시스템 및 방법
TWI760756B (zh) 共用代碼之系統與代碼共用方法
US10901883B2 (en) Embedded memory management scheme for real-time applications
KR20150101870A (ko) 메모리의 뱅크 충돌을 방지하기 위한 방법 및 장치
US9690600B2 (en) Reconfigurable processor and method of operating the same
CN112654965A (zh) 动态模块的外部分页和交换
US20080072009A1 (en) Apparatus and method for handling interrupt disabled section and page pinning apparatus and method
TW201005649A (en) Operating system fast run command
US20200019442A1 (en) Programmable State Machine Controller in a Parallel Processing System
KR102560087B1 (ko) 매니코어 시스템의 메모리 주소 변환 방법 및 장치
KR20110067795A (ko) 실시간 프로세스의 응답성 개선을 위한 tcm운용방법
US20240201876A1 (en) Method and apparatus for managing memory
US20230393849A1 (en) Method and apparatus to expedite system services using processing-in-memory (pim)
JP5858947B2 (ja) 情報処理装置及び動作周波数/動作電圧制御方法
US20200226067A1 (en) Coherent multiprocessing enabled compute in storage and memory