[go: up one dir, main page]

CN217821599U - Device for multiple hosts to share access memory - Google Patents

Device for multiple hosts to share access memory Download PDF

Info

Publication number
CN217821599U
CN217821599U CN202222152502.9U CN202222152502U CN217821599U CN 217821599 U CN217821599 U CN 217821599U CN 202222152502 U CN202222152502 U CN 202222152502U CN 217821599 U CN217821599 U CN 217821599U
Authority
CN
China
Prior art keywords
comparator
host
write
gate
bus
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
Application number
CN202222152502.9U
Other languages
Chinese (zh)
Inventor
刘明辉
刘延峰
张嘉荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Ancun Technology Co ltd
Original Assignee
Suzhou Kuhan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Kuhan Information Technology Co Ltd filed Critical Suzhou Kuhan Information Technology Co Ltd
Priority to CN202222152502.9U priority Critical patent/CN217821599U/en
Application granted granted Critical
Publication of CN217821599U publication Critical patent/CN217821599U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

本实用新型公开了一种多主机共享访问内存的装置。所述装置包括:多个主机、总线、多个控制寄存器、保护电路和多个内存空间,其中,所述多个控制寄存器与所述多个内存空间一一对应,所述多个主机通过写总线和读总线与所述总线连接,所述总线通过写总线与所述多个控制寄存器和所述保护电路连接,所述多个控制寄存器和所述多个内存空间通过读总线与所述总线连接,所述保护电路与所述多个内存空间连接。本实用新型可以将申请写权限、确认写权限的两个步操作合并成一个步骤,节省的主机的访问时间,并且,保护每一个内存区间的写操作的唯一性,可以保护数据的安全。

Figure 202222152502

The utility model discloses a device for sharing and accessing memory by multiple hosts. The device includes: a plurality of hosts, a bus, a plurality of control registers, a protection circuit and a plurality of memory spaces, wherein the plurality of control registers correspond to the plurality of memory spaces one by one, and the plurality of hosts write The bus and the read bus are connected to the bus, the bus is connected to the plurality of control registers and the protection circuit through a write bus, and the plurality of control registers and the plurality of memory spaces are connected to the bus through a read bus connected, the protection circuit is connected to the plurality of memory spaces. The utility model can combine the two steps of applying for writing permission and confirming writing permission into one step, which saves the access time of the host, and protects the uniqueness of the writing operation of each memory interval, which can protect the security of data.

Figure 202222152502

Description

多主机共享访问内存的装置A device for multiple hosts to share access to memory

技术领域technical field

本实用新型涉及多主机内存访问技术领域,更具体地涉及一种多主机共享访问内存的装置。The utility model relates to the technical field of multi-host memory access, in particular to a device for multi-host shared memory access.

背景技术Background technique

通常在实现的一个多主机的访问系统中,主机需要进行如下操作才能锁定内存的访问权限:Usually, in a multi-host access system, the host needs to perform the following operations to lock the memory access permission:

(1)主机写内存控制寄存器申请锁定内存写权限。(1) The host writes the memory control register to apply for lock memory write permission.

(2)主机读内存的状态寄存器,检查申请锁定写权限是否申请成功。(2) The host reads the status register of the memory, and checks whether the application for lock write permission is successful.

(3)如果申请成功,开始写操作,如果申请不成功返回(1)重新进行锁定写内存权限的申请。(3) If the application is successful, start the write operation, if the application is unsuccessful, return to (1) re-apply for the lock write memory permission.

在上述的操作中,从申请写权限到确认写权限,最少要用两次访问,对于一个高速的访问系统来说,可能会造成不必要的数据带宽的浪费。并且所有数据的安全性全部依赖多主机读写内存的申请权限寄存器的值和状态寄存器的值,通过主机主动屏蔽写操作,如果主机误出发的写操作,依然会错误的改变内存的数据,造成不必要的错误。In the above operation, at least two visits are required from applying for write permission to confirming write permission. For a high-speed access system, unnecessary waste of data bandwidth may be caused. Moreover, the security of all data depends on the value of the application permission register and the value of the status register for multi-hosts to read and write the memory. The host actively shields the write operation. If the host initiates the write operation by mistake, the data in the memory will still be changed by mistake, causing Unnecessary errors.

发明内容Contents of the invention

本实用新型的目的在于提供一种多主机共享访问内存的装置,将申请写权限、确认写权限的两个步操作合并成一个步骤,节省的主机的访问时间,并且,保护每一个内存区间的写操作的唯一性,可以保护数据的安全。The purpose of the utility model is to provide a device for sharing memory access by multiple hosts, which combines the two steps of applying for write permission and confirming write permission into one step, saving the access time of the host, and protecting each memory interval. The uniqueness of the write operation can protect the security of the data.

本申请公开了一种多主机共享访问内存的装置,包括:多个主机、总线、多个控制寄存器、保护电路和多个内存空间,其中,所述多个控制寄存器与所述多个内存空间一一对应,所述多个主机通过写总线和读总线与所述总线连接,所述总线通过写总线与所述多个控制寄存器和所述保护电路连接,所述多个控制寄存器和所述多个内存空间通过读总线与所述总线连接,所述保护电路与所述多个内存空间连接。The present application discloses a device for sharing and accessing memory by multiple hosts, including: multiple hosts, a bus, multiple control registers, protection circuits, and multiple memory spaces, wherein the multiple control registers and the multiple memory spaces In one-to-one correspondence, the multiple hosts are connected to the bus through a write bus and a read bus, the bus is connected to the multiple control registers and the protection circuit through a write bus, and the multiple control registers and the Multiple memory spaces are connected to the bus through a read bus, and the protection circuit is connected to the multiple memory spaces.

在一个优选例中,每个所述控制寄存器包括:第一比较器、第二比较器、第一与门、第一选通器和触发器;In a preferred example, each of the control registers includes: a first comparator, a second comparator, a first AND gate, a first selector and a flip-flop;

所述第一比较器的第一输入端、所述第一选通器的第一输入端和所述触发器的输出端相连,所述第一比较器的第二输入端连接预设值,所述第一比较器的输出端连接所述第一与门的第一输入端;The first input terminal of the first comparator, the first input terminal of the first selector are connected to the output terminal of the flip-flop, the second input terminal of the first comparator is connected to a preset value, The output end of the first comparator is connected to the first input end of the first AND gate;

所述第二比较器的第一输入端连接读地址信号,第二输入端连接寄存器地址,输出端连接所述第一与门的第二输入端;The first input end of the second comparator is connected to the read address signal, the second input end is connected to the register address, and the output end is connected to the second input end of the first AND gate;

所述第一与门的使能端连接读使能信号,输出端连接所述第一选通器的使能端;The enable end of the first AND gate is connected to a read enable signal, and the output end is connected to the enable end of the first strobe;

所述第一选通器的第二输入端连接主机序列号,输出端连接所述触发器的数据端,所述触发器的使能端连接时钟信号。The second input end of the first strobe is connected to the host serial number, the output end is connected to the data end of the flip-flop, and the enable end of the flip-flop is connected to a clock signal.

在一个优选例中,所述读使能信号处于有效状态,并且,所述触发器在所述时钟信号的当前时钟周期的输出为所述预设值,所述触发器的值被更新为所述主机序列号,并且,在所述时钟信号的下一个时钟周期的输出为所述主机序列号。In a preferred example, the read enable signal is in an active state, and the output of the flip-flop in the current clock cycle of the clock signal is the preset value, and the value of the flip-flop is updated to the The host serial number, and the output of the next clock cycle of the clock signal is the host serial number.

在一个优选例中,每个所述控制寄存器还包括:第三比较器、第四比较器、第二与门和第二选通器;In a preferred example, each of the control registers further includes: a third comparator, a fourth comparator, a second AND gate and a second selector;

所述第三比较器的第一输入端、所述第二选通器的第一输入端和所述触发器的输出端相连,所述第三比较器的第二输入端连接主机序列号,所述第三比较器的输出端连接所述第二与门的第一输入端;The first input end of the third comparator, the first input end of the second selector are connected to the output end of the flip-flop, the second input end of the third comparator is connected to the host serial number, The output end of the third comparator is connected to the first input end of the second AND gate;

所述第四比较器的第一输入端连接写地址信号,第二输入端连接寄存器地址,输出端连接所述第二与门的第二输入端;The first input end of the fourth comparator is connected to the write address signal, the second input end is connected to the register address, and the output end is connected to the second input end of the second AND gate;

所述第二与门的使能端连接写使能信号,输出端连接所述第二选通器的使能端;The enable end of the second AND gate is connected to the write enable signal, and the output end is connected to the enable end of the second gate;

所述第二选通器的第二输入端连接预设值,输出端连接所述触发器的数据端,所述触发器的使能端连接时钟信号。The second input end of the second gate is connected to a preset value, the output end is connected to the data end of the flip-flop, and the enable end of the flip-flop is connected to a clock signal.

在一个优选例中,所述写使能信号处于有效状态,并且,所述触发器在所述时钟信号的当前时钟周期的输出为所述主机序列号,所述触发器的值被更新为所述预设值。In a preferred example, the write enable signal is in a valid state, and the output of the flip-flop in the current clock cycle of the clock signal is the serial number of the host, and the value of the flip-flop is updated to the the default value mentioned above.

在一个优选例中,所述保护电路包括:In a preferred example, the protection circuit includes:

多路选通器,所述多路选通器的输入端连接所述多个控制寄存器的每个的输出端,使能端连接内存写地址信号;A multiplexer, the input end of the multiplexer is connected to the output end of each of the plurality of control registers, and the enable end is connected to the memory write address signal;

第五比较器,所述第五比较器的第一输入端连接所述多路选通器的输出端,第二输入端连接写访问主机序列号;以及A fifth comparator, the first input terminal of the fifth comparator is connected to the output terminal of the multiplexer, and the second input terminal is connected to the serial number of the write access host; and

第三与门,所述第三与门的第一输入端连接所述第五比较器的输出端,第二输入端连接内存写使能信号,输出端连接所述多个内存空间。A third AND gate, the first input end of the third AND gate is connected to the output end of the fifth comparator, the second input end is connected to the memory write enable signal, and the output end is connected to the plurality of memory spaces.

在一个优选例中,所述多路选通器的使能端连接区间判断逻辑,所述区间判断逻辑用于根据所述内存写地址信号判断选通所述多个控制寄存器中的一个。In a preferred example, the enabling terminal of the multiplexer is connected to an interval judgment logic, and the interval judgment logic is used to judge and select one of the plurality of control registers according to the memory write address signal.

本实用新型实施方式与现有技术相比,主要区别及其效果在于:Compared with the prior art, the utility model implementation mode has the main difference and its effects in that:

(1)主机通过读操作,将申请写权限、确认写权限的两个步操作合并成一个步骤,节省的主机的访问时间。(1) The host merges the two steps of applying for write permission and confirming write permission into one step through the read operation, saving the access time of the host.

(2)内存区间可自由分配,可以做到更加精细的读写操作的管理。(2) The memory range can be allocated freely, and more fine-grained management of read and write operations can be achieved.

(3)硬件保护电路比较主机访问序列号与内存控制寄存器中存储的序列号,保护每一个内存区间的写操作的唯一性,保护数据的安全。(3) The hardware protection circuit compares the host access sequence number with the sequence number stored in the memory control register, protects the uniqueness of the write operation of each memory interval, and protects the security of data.

(4)硬件保护电路对主机序列号的判断在一个时钟周期完成,不会增加额外的延时,主机访问更高效。(4) The judgment of the serial number of the host computer by the hardware protection circuit is completed in one clock cycle, without additional delay, and the host access is more efficient.

应理解,在本实用新型范围内中,本实用新型的上述各技术特征和在下文(如实施例)中具体描述的各技术特征之间都可以互相组合,从而构成新的或优选的技术方案。限于篇幅,在此不再一一累述。It should be understood that within the scope of the present utility model, the above-mentioned technical features of the present utility model and the technical features specifically described in the following (such as embodiments) can be combined with each other to form new or preferred technical solutions . Due to space limitations, we will not repeat them here.

附图说明Description of drawings

为了更清楚地说明本实用新型实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做简单地介绍,显而易见地,下面描述中的附图仅仅是本实用新型的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are only some embodiments of the utility model, and those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是本实用新型一个实例中的多主机共享访问内存的装置的示意图。FIG. 1 is a schematic diagram of a device for sharing and accessing memory by multiple hosts in an example of the present invention.

图2是本实用新型一个实例中的控制寄存器的读逻辑的示意图。Fig. 2 is a schematic diagram of the read logic of the control register in an example of the present invention.

图3是本实用新型一个实例中的控制寄存器的读逻辑的时序示意图。FIG. 3 is a timing diagram of the read logic of the control register in an example of the present invention.

图4是本实用新型一个实例中的控制寄存器的写逻辑的示意图。Fig. 4 is a schematic diagram of the writing logic of the control register in an example of the present invention.

图5是本实用新型一个实例中的保护电路的示意图。Fig. 5 is a schematic diagram of a protection circuit in an example of the present invention.

各附图中,各标示如下:In each attached drawing, each mark is as follows:

101.1,101.2~101.m-主机;101.1, 101.2~101.m-host;

102-总线;102-bus;

103.1,103.2~103.n-控制寄存器;103.1, 103.2~103.n-control register;

104-保护电路;104-protection circuit;

105.1,105.2~105.n-内存空间;105.1, 105.2~105.n-memory space;

201-第一比较器;201 - the first comparator;

202-第二比较器;202 - second comparator;

203-第一与门;203-the first AND gate;

204-第一选通器;204 - first gate;

205-触发器;205 - trigger;

301-第三比较器;301 - the third comparator;

302-第四比较器;302 - the fourth comparator;

303-第二与门;303-the second AND gate;

304-第二选通器;304 - second gate;

401-多路选通器;401 - multiplexer;

402-第五比较器;402 - fifth comparator;

403-第三与门。403-The third AND gate.

具体实施方式Detailed ways

在以下的叙述中,为了使读者更好地理解本申请而提出了许多技术细节。但是,本领域的普通技术人员可以理解,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。In the following description, many technical details are proposed in order to enable readers to better understand the application. However, those skilled in the art can understand that the technical solutions claimed in this application can be realized even without these technical details and various changes and modifications based on the following implementation modes.

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manner of the present application will be further described in detail below in conjunction with the accompanying drawings.

本实用新型提供了一种多主机共享访问内存的装置,典型地,多主机共享访问内存的装置包括:多个主机、总线、多个控制寄存器、保护电路和多个内存空间。其中,所述多个控制寄存器与所述多个内存空间一一对应,所述多个主机通过写总线和读总线与所述总线连接,所述总线通过写总线与所述多个控制寄存器和所述保护电路连接,所述多个控制寄存器和所述多个内存空间通过读总线与所述总线连接,所述保护电路与所述多个内存空间连接。The utility model provides a device for sharing and accessing a memory by multiple hosts. Typically, the device for sharing and accessing a memory by multiple hosts includes: multiple hosts, a bus, multiple control registers, protection circuits and multiple memory spaces. Wherein, the plurality of control registers are in one-to-one correspondence with the plurality of memory spaces, the plurality of hosts are connected to the bus through a write bus and a read bus, and the bus is connected to the plurality of control registers and the plurality of memory spaces through a write bus. The protection circuit is connected, the multiple control registers and the multiple memory spaces are connected to the bus through a read bus, and the protection circuit is connected to the multiple memory spaces.

下面结合具体实施例,进一步阐述本发明。应理解,这些实施例仅用于说明本发明而不用于限制本发明的范围。此外,附图为示意图,因此本发明装置和设备的并不受所述示意图的尺寸或比例限制。Below in conjunction with specific embodiment, further illustrate the present invention. It should be understood that these examples are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, the drawings are schematic diagrams, so the device and equipment of the present invention are not limited by the size or scale of the schematic diagrams.

图1是本实用新型一个实例中的多主机共享访问内存的装置的示意图。多主机共享访问内存的装置包括:多个主机101.1,101.2~101.m、总线102、多个控制寄存器103.1,103.2~103.n、保护电路104和多个内存空间105.1,105.2~105.n。多个控制寄存器103.1,103.2~103.n与多个内存空间105.1,105.2~105.n之间一一对应。多个主机101.1,101.2~101.N通过写总线和读总线与总线102连接,总线102通过写总线与多个控制寄存器器103.1,103.2~103.n和保护电路104连接。多个控制寄存器103.1,103.2~103.n和多个内存空间105.1,105.2~105.n通过读总线与总线连接,保护电路104与多个内存空间105.1,105.2~105.n连接。FIG. 1 is a schematic diagram of a device for sharing and accessing memory by multiple hosts in an example of the present invention. The device for sharing and accessing memory by multiple hosts includes: multiple hosts 101.1, 101.2-101.m, bus 102, multiple control registers 103.1, 103.2-103.n, protection circuit 104 and multiple memory spaces 105.1, 105.2-105.n . There is a one-to-one correspondence between multiple control registers 103.1, 103.2-103.n and multiple memory spaces 105.1, 105.2-105.n. A plurality of hosts 101.1, 101.2-101.N are connected to the bus 102 through a write bus and a read bus, and the bus 102 is connected to a plurality of control registers 103.1, 103.2-103.n and a protection circuit 104 through a write bus. A plurality of control registers 103.1, 103.2-103.n and a plurality of memory spaces 105.1, 105.2-105.n are connected to the bus through a read bus, and a protection circuit 104 is connected to a plurality of memory spaces 105.1, 105.2-105.n.

本方案是一个硬件解析读命令申请写权限,并且通过硬件逻辑做写保护,整块内存划分为多个空间,每一个空间通过一个内存控制寄存器独立的控制读写权限。总线模块完成读写数据以及配置寄存器总线仲裁,仲裁后会转换成带有主机序列号的读写命令。This solution is a hardware analysis read command to apply for write permission, and write protection through hardware logic, the whole memory is divided into multiple spaces, and each space independently controls read and write permissions through a memory control register. The bus module completes the read and write data and configures the register bus arbitration. After the arbitration, it will be converted into a read and write command with the serial number of the host.

本申请中内存空间是存储模块,可以通过设置为不同的区间的起始地址和区间大小,实现内存区间的数量以及每个区间空间大小的灵活配置。In this application, the memory space is a storage module, which can realize flexible configuration of the number of memory intervals and the space size of each interval by setting different interval start addresses and interval sizes.

图2是本实用新型一个实例中的控制寄存器的读逻辑的示意图。每个控制寄存器包括:第一比较器201、第二比较器202、第一与门203、第一选通器204和触发器205。第一比较器201的第一输入端、第一选通器204的第一输入端和触发器205的输出端相连,第一比较器201的第二输入端连接预设值(或默认值),第一比较器202的输出端连接第一与门203的第一输入端。第二比较器202的第一输入端连接读地址信号,第二输入端连接寄存器地址,输出端连接第一与门203的第二输入端。第一与门203的使能端连接读使能信号,输出端连接第一选通器204的使能端。第一选通器204的第二输入端连接主机序列号,输出端连接触发器205的数据端,触发器的使能端连接时钟信号。Fig. 2 is a schematic diagram of the read logic of the control register in an example of the present invention. Each control register includes: a first comparator 201 , a second comparator 202 , a first AND gate 203 , a first gate 204 and a flip-flop 205 . The first input end of the first comparator 201, the first input end of the first selector 204 and the output end of the flip-flop 205 are connected, and the second input end of the first comparator 201 is connected with a preset value (or default value) , the output end of the first comparator 202 is connected to the first input end of the first AND gate 203 . The first input end of the second comparator 202 is connected to the read address signal, the second input end is connected to the register address, and the output end is connected to the second input end of the first AND gate 203 . The enable end of the first AND gate 203 is connected to the read enable signal, and the output end is connected to the enable end of the first gate 204 . The second input end of the first selector 204 is connected to the host serial number, the output end is connected to the data end of the flip-flop 205 , and the enable end of the flip-flop is connected to the clock signal.

控制寄存器模块是主机申请写锁定权限寄存器的模块,其中每一个写权限寄存器,对应一个区间内存的写权限。每一个写权限寄存器的默认值为0,表示该对应的内存区间没有被锁定写权限,所有的主机都可以写该区间。并且都可以申请写权限锁定。The control register module is a module for the host to apply for the write lock permission register, and each write permission register corresponds to the write permission of an interval memory. The default value of each write permission register is 0, which means that the corresponding memory range is not locked for write permission, and all hosts can write to this range. And all can apply for write permission lock.

可以通过主机读寄存器完成寄存器值的更新,如果该寄存器的值为0,则会在读周期时,将该寄存器的值赋值为该主机的序列号,同时返回该主机序列号给主机,表示该主机申请写权限成功,已经锁定了该内存区间的写操作。如图3所示,读使能信号处于有效状态,并且,触发器205在时钟信号的当前时钟周期的输出为预设值,触发器205的值被更新为主机序列号,并且,在时钟信号的下一个时钟周期的输出为主机序列号。The update of the register value can be completed by the host reading the register. If the value of the register is 0, the value of the register will be assigned as the serial number of the host during the read cycle, and the serial number of the host will be returned to the host at the same time, indicating that the host The application for write permission is successful, and the write operation of this memory range has been locked. As shown in Figure 3, the read enable signal is in an effective state, and the output of the flip-flop 205 in the current clock cycle of the clock signal is a preset value, the value of the flip-flop 205 is updated as the host serial number, and, in the clock signal The output of the next clock cycle is the host serial number.

如果该寄存器已经被其他主机锁定,则主机读该寄存器的时候会返回其他主机的序列号,表示该内存区间已被其他主机锁定,当前申请写权限的主机无法申请该内存区间的写操作。If the register has been locked by other hosts, when the host reads the register, it will return the serial number of other hosts, indicating that the memory range has been locked by other hosts, and the host currently applying for write permission cannot apply for the write operation of this memory range.

图4是本实用新型一个实例中的控制寄存器的写逻辑的示意图。每个控制寄存器包括:第三比较器301、第四比较器302、第二与门303、第二选通器304和触发器305。第三比较器301的第一输入端、第二选通器304的第一输入端和触发器305的输出端相连,第三比较器301的第二输入端连接主机序列号,第三比较器301的输出端连接第二与门303的第一输入端。第四比较器302的第一输入端连接写地址信号,第二输入端连接寄存器地址,输出端连接第二与门303的第二输入端。第二与门303的使能端连接写使能信号,输出端连接第二选通器304的使能端。第二选通器304的第二输入端连接预设值,输出端连接触发器305的数据端,触发器305的使能端连接时钟信号。可以理解的是,图2中的写逻辑和图4中的读逻辑构成本申请的控制寄存器103。Fig. 4 is a schematic diagram of the writing logic of the control register in an example of the present invention. Each control register includes: a third comparator 301 , a fourth comparator 302 , a second AND gate 303 , a second gate 304 and a flip-flop 305 . The first input end of the third comparator 301, the first input end of the second strobe 304 are connected with the output end of the flip-flop 305, the second input end of the third comparator 301 is connected with the host serial number, and the third comparator The output end of 301 is connected to the first input end of the second AND gate 303 . The first input terminal of the fourth comparator 302 is connected to the write address signal, the second input terminal is connected to the register address, and the output terminal is connected to the second input terminal of the second AND gate 303 . The enable end of the second AND gate 303 is connected to the write enable signal, and the output end is connected to the enable end of the second gate 304 . The second input terminal of the second selector 304 is connected to the preset value, the output terminal is connected to the data terminal of the flip-flop 305 , and the enable terminal of the flip-flop 305 is connected to the clock signal. It can be understood that the write logic in FIG. 2 and the read logic in FIG. 4 constitute the control register 103 of the present application.

申请到该内存区间写权限的主机可以通过写该寄存器,清除其中存储的主机序列号,使该寄存器返回到默认值,其他没有申请到该内存区间写权限的主机无法通过写操作改变该寄存器的值。写使能信号处于有效状态,并且,触发器205在时钟信号的当前时钟周期的输出为主机序列号,触发器205的值被更新为预设值。The host that has applied for the write permission of this memory area can clear the serial number of the host stored in this register by writing to this register, and return the register to the default value. Other hosts that have not applied for the write permission of this memory area cannot change the value of this register by writing value. The write enable signal is in a valid state, and the output of the flip-flop 205 in the current clock cycle of the clock signal is the host serial number, and the value of the flip-flop 205 is updated to a preset value.

图5是本实用新型一个实例中的保护电路的示意图。保护电路包括:多路选通器401、第五比较器402、第三与门403。多路选通器401的输入端连接多个控制寄存器103.1,103.2~103.n的每个的输出端,使能端连接内存写地址信号。第五比较器402的第一输入端连接多路选通器401的输出端,第二输入端连接写访问主机序列号。第三与门403的第一输入端连接第五比较器402的输出端,第二输入端连接内存写使能信号,输出端连接多个内存空间105.1,105.2~105.n。在一个实施例中,多路选通器401的使能端连接区间判断逻辑,区间判断逻辑用于根据内存写地址信号判断选通多个控制寄存器中的一个。区间判断逻辑是指主机发出写内存空间的命令时,将内存写地址信号的值与各个内存区间的起始地址作比较,判断出该写命令对应的内存区间,生成内存控制寄存器选择信号。利用该内存寄存器选择信号在多路选通器401选择该内存区间对应的控制寄存器,输出拥有写权限的主机序列号。Fig. 5 is a schematic diagram of a protection circuit in an example of the present invention. The protection circuit includes: a multiplexer 401 , a fifth comparator 402 , and a third AND gate 403 . The input end of the multiplexer 401 is connected to the output end of each of the multiple control registers 103.1, 103.2˜103.n, and the enable end is connected to the memory write address signal. The first input terminal of the fifth comparator 402 is connected to the output terminal of the multiplexer 401 , and the second input terminal is connected to the serial number of the write access host. The first input end of the third AND gate 403 is connected to the output end of the fifth comparator 402, the second input end is connected to the memory write enable signal, and the output end is connected to a plurality of memory spaces 105.1, 105.2˜105.n. In one embodiment, the enabling terminal of the multiplexer 401 is connected to a section judgment logic, and the section judgment logic is used to judge and select one of the multiple control registers according to the memory write address signal. Interval judgment logic means that when the host issues a command to write memory space, it compares the value of the memory write address signal with the start address of each memory interval, determines the memory interval corresponding to the write command, and generates a memory control register selection signal. Using the memory register selection signal, the multiplexer 401 selects the control register corresponding to the memory interval, and outputs the serial number of the host with write permission.

硬件写保护电路是防止主机误触发写没有申请到写权限内存区间的机制。硬件保护电路收到主机的写命令后,首先根据内存写地址信号判断出操作哪一个内存区间,然后选择对应的控制寄存器的值与写命令的主机序列号做比较。序列号一致时候,内存写使能有效,写数据被写入该内存区间,写命令完成。序列号不一致,内存写使能无效,写数据被丢弃,并且通过写数据接口返回给写失败的代码给主机,表示写操作失败。The hardware write protection circuit is a mechanism to prevent the host from accidentally triggering to write the memory range that has not applied for write permission. After the hardware protection circuit receives the write command from the host, it first judges which memory interval to operate according to the memory write address signal, and then selects the value of the corresponding control register to compare with the host serial number of the write command. When the serial numbers are consistent, the memory write enable is valid, the write data is written into the memory area, and the write command is completed. The serial numbers are inconsistent, the memory write enable is invalid, the write data is discarded, and the write failure code is returned to the host through the write data interface, indicating that the write operation failed.

需要说明的是,在本专利的权利要求和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in the claims and description of this patent, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or Any such actual relationship or order between such entities or operations is implied. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

在本实用新型提及的所有文献都在本申请中引用作为参考,就如同每一篇文献被单独引用作为参考那样。此外应理解,在阅读了本实用新型的上述讲授内容之后,本领域技术人员可以对本实用新型作各种改动或修改,这些等价形式同样落于本申请所附权利要求书所限定的范围。All documents mentioned in this application are incorporated by reference in this application as if each were individually incorporated by reference. In addition, it should be understood that after reading the above teaching content of the utility model, those skilled in the art can make various changes or modifications to the utility model, and these equivalent forms also fall within the scope defined by the appended claims of the application.

Claims (7)

1.一种多主机共享访问内存的装置,其特征在于,包括:多个主机、总线、多个控制寄存器、保护电路和多个内存空间,其中,所述多个控制寄存器与所述多个内存空间一一对应,所述多个主机通过写总线和读总线与所述总线连接,所述总线通过写总线与所述多个控制寄存器和所述保护电路连接,所述多个控制寄存器和所述多个内存空间通过读总线与所述总线连接,所述保护电路与所述多个内存空间连接。1. A device for multi-host shared memory access, characterized in that it comprises: multiple hosts, a bus, multiple control registers, protection circuits, and multiple memory spaces, wherein the multiple control registers and the multiple One-to-one correspondence between memory spaces, the plurality of hosts are connected to the bus through a write bus and a read bus, the bus is connected to the plurality of control registers and the protection circuit through a write bus, and the plurality of control registers and The multiple memory spaces are connected to the bus through a read bus, and the protection circuit is connected to the multiple memory spaces. 2.根据权利要求1所述的多主机共享访问内存的装置,其特征在于,每个所述控制寄存器包括:第一比较器、第二比较器、第一与门、第一选通器和触发器;2. The device for multi-host shared memory access according to claim 1, wherein each of said control registers comprises: a first comparator, a second comparator, a first AND gate, a first strobe and trigger; 所述第一比较器的第一输入端、所述第一选通器的第一输入端和所述触发器的输出端相连,所述第一比较器的第二输入端连接预设值,所述第一比较器的输出端连接所述第一与门的第一输入端;The first input terminal of the first comparator, the first input terminal of the first selector are connected to the output terminal of the flip-flop, the second input terminal of the first comparator is connected to a preset value, The output end of the first comparator is connected to the first input end of the first AND gate; 所述第二比较器的第一输入端连接读地址信号,第二输入端连接寄存器地址,输出端连接所述第一与门的第二输入端;The first input end of the second comparator is connected to the read address signal, the second input end is connected to the register address, and the output end is connected to the second input end of the first AND gate; 所述第一与门的使能端连接读使能信号,输出端连接所述第一选通器的使能端;The enable end of the first AND gate is connected to a read enable signal, and the output end is connected to the enable end of the first strobe; 所述第一选通器的第二输入端连接主机序列号,输出端连接所述触发器的数据端,所述触发器的使能端连接时钟信号。The second input end of the first strobe is connected to the host serial number, the output end is connected to the data end of the flip-flop, and the enable end of the flip-flop is connected to a clock signal. 3.根据权利要求2所述的多主机共享访问内存的装置,其特征在于,所述读使能信号处于有效状态,并且,所述触发器在所述时钟信号的当前时钟周期的输出为所述预设值,所述触发器的值被更新为所述主机序列号,并且,在所述时钟信号的下一个时钟周期的输出为所述主机序列号。3. The device for multi-host shared memory access according to claim 2, wherein the read enable signal is in an active state, and the output of the flip-flop in the current clock cycle of the clock signal is the The preset value, the value of the flip-flop is updated to the serial number of the host, and the output of the next clock cycle of the clock signal is the serial number of the host. 4.根据权利要求2所述的多主机共享访问内存的装置,其特征在于,每个所述控制寄存器还包括:第三比较器、第四比较器、第二与门和第二选通器;4. The device for multi-host shared memory access according to claim 2, wherein each of the control registers further comprises: a third comparator, a fourth comparator, a second AND gate and a second strobe ; 所述第三比较器的第一输入端、所述第二选通器的第一输入端和所述触发器的输出端相连,所述第三比较器的第二输入端连接主机序列号,所述第三比较器的输出端连接所述第二与门的第一输入端;The first input end of the third comparator, the first input end of the second selector are connected to the output end of the flip-flop, the second input end of the third comparator is connected to the host serial number, The output end of the third comparator is connected to the first input end of the second AND gate; 所述第四比较器的第一输入端连接写地址信号,第二输入端连接寄存器地址,输出端连接所述第二与门的第二输入端;The first input end of the fourth comparator is connected to the write address signal, the second input end is connected to the register address, and the output end is connected to the second input end of the second AND gate; 所述第二与门的使能端连接写使能信号,输出端连接所述第二选通器的使能端;The enable end of the second AND gate is connected to the write enable signal, and the output end is connected to the enable end of the second gate; 所述第二选通器的第二输入端连接预设值,输出端连接所述触发器的数据端,所述触发器的使能端连接时钟信号。The second input end of the second gate is connected to a preset value, the output end is connected to the data end of the flip-flop, and the enable end of the flip-flop is connected to a clock signal. 5.根据权利要求4所述的多主机共享访问内存的装置,其特征在于,所述写使能信号处于有效状态,并且,所述触发器在所述时钟信号的当前时钟周期的输出为所述主机序列号,所述触发器的值被更新为所述预设值。5. The device for multi-master shared memory access according to claim 4, wherein the write enable signal is in an active state, and the output of the flip-flop in the current clock cycle of the clock signal is the the serial number of the host, and the value of the trigger is updated to the preset value. 6.根据权利要求1所述的多主机共享访问内存的装置,其特征在于,所述保护电路包括:6. The device for multi-host shared memory access according to claim 1, wherein the protection circuit comprises: 多路选通器,所述多路选通器的输入端连接所述多个控制寄存器的每个的输出端,使能端连接内存写地址信号;A multiplexer, the input end of the multiplexer is connected to the output end of each of the plurality of control registers, and the enable end is connected to the memory write address signal; 第五比较器,所述第五比较器的第一输入端连接所述多路选通器的输出端,第二输入端连接写访问主机序列号;以及A fifth comparator, the first input terminal of the fifth comparator is connected to the output terminal of the multiplexer, and the second input terminal is connected to the serial number of the write access host; and 第三与门,所述第三与门的第一输入端连接所述第五比较器的输出端,第二输入端连接内存写使能信号,输出端连接所述多个内存空间。A third AND gate, the first input end of the third AND gate is connected to the output end of the fifth comparator, the second input end is connected to the memory write enable signal, and the output end is connected to the plurality of memory spaces. 7.根据权利要求6所述的多主机共享访问内存的装置,其特征在于,所述多路选通器的使能端连接区间判断逻辑,所述区间判断逻辑用于根据所述内存写地址信号判断选通所述多个控制寄存器中的一个。7. The device for multi-host shared memory access according to claim 6, wherein the enabling end of the multiplexer is connected to an interval judgment logic, and the interval judgment logic is used to write address according to the memory The signal judgment gates one of the plurality of control registers.
CN202222152502.9U 2022-08-16 2022-08-16 Device for multiple hosts to share access memory Active CN217821599U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202222152502.9U CN217821599U (en) 2022-08-16 2022-08-16 Device for multiple hosts to share access memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202222152502.9U CN217821599U (en) 2022-08-16 2022-08-16 Device for multiple hosts to share access memory

Publications (1)

Publication Number Publication Date
CN217821599U true CN217821599U (en) 2022-11-15

Family

ID=83974733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202222152502.9U Active CN217821599U (en) 2022-08-16 2022-08-16 Device for multiple hosts to share access memory

Country Status (1)

Country Link
CN (1) CN217821599U (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119513005A (en) * 2024-11-08 2025-02-25 昕原半导体(上海)有限公司 Chip assembly, communication method and computer program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119513005A (en) * 2024-11-08 2025-02-25 昕原半导体(上海)有限公司 Chip assembly, communication method and computer program product

Similar Documents

Publication Publication Date Title
US12339788B2 (en) Block or page lock features in serial interface memory
JP4550439B2 (en) ECC controller
CN100492334C (en) Serial Peripheral Interface Device
US20060064537A1 (en) Memory card having a storage cell and method of controlling the same
CN100419901C (en) Memory device with different burst sequential addressing for read and write operations
US20080005387A1 (en) Semiconductor device and data transfer method
US8140797B2 (en) Integrated circuit and method of securing access to an on-chip memory
CN217821599U (en) Device for multiple hosts to share access memory
TW201643737A (en) Configuring serial devices
CN103389893B (en) A kind of configuration register reading/writing method and device
CN110765060B (en) MDIO bus-to-parallel bus conversion method and device, equipment and medium
JP4116805B2 (en) Internal bus test device and internal bus test method
JP4257358B2 (en) Bus control method and apparatus
US11360713B2 (en) Semiconductor device and debug system
US20020188771A1 (en) Direct memory access controller for carrying out data transfer by determining whether or not burst access can be utilized in an external bus and access control method thereof
KR100441996B1 (en) Direct Memory Access(DMA) Controller and control method
CN114721581B (en) Control module for synchronous dynamic random access memory and control method thereof
US12259818B2 (en) Flash memory controller and data programming method
CN111290977B (en) Register access system and method based on DDR multi-data unit
JPH08106784A (en) Synchronous memory control system and device
JPH02188856A (en) Memory access circuit
JPS63126047A (en) Memory control system
JPS63271652A (en) Dma controller
JPH0696006A (en) DMA controller
JPH01125621A (en) Register setting system

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20240218

Granted publication date: 20221115

PP01 Preservation of patent right
PD01 Discharge of preservation of patent

Date of cancellation: 20250807

Granted publication date: 20221115

PD01 Discharge of preservation of patent
TR01 Transfer of patent right

Effective date of registration: 20250908

Address after: 215103 Jiangsu Province Suzhou City Wuzhong District Nan Guandu Road 521 Building 4 2nd Floor Room 163

Patentee after: Suzhou Ancun Technology Co.,Ltd.

Country or region after: China

Address before: 215123 Jiangsu Province Suzhou City Suzhou Industrial Park Xinghu Street 328 Creative Industry Park Unit 17-A401

Patentee before: Suzhou kuhan Information Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right