Questions tagged [cpu-architecture]

The hardware microarchitecture (x86, x86_64, ARM, ...) of a CPU or microcontroller.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

After running this MIPS instruction, what will be stored in the memory?

In a MIPS architecture, if a register $s5 contains a value 0xE3A700F2 and register $t0 contains a value 16 in decimal, and we're going to run an instruction "sw $s5 4($t0)"... After running ...
letMeLeave's user avatar
1 vote
0 answers
24 views

why are CAS / other common operations limited to fractions of a cache line?

My understanding is that CAS, FAA, and similar operations usually operate on the machine word size (e.g. 64 bits). The hard parts of implementing these operations in hardware has to do with ...
ajp's user avatar
  • 1,767
0 votes
0 answers
16 views

Finding Cache configuration

If you're given the hit rate for a cache config (associativity, set size, block size and capacity) how do you reverse engineer this to find out the configuration if another hit rate was given? so if i ...
astra's user avatar
  • 11
0 votes
3 answers
52 views

Are hardware interrupts still needed on embedded devices (as opposed to flags)?

In general, ISR for hardware interrupts on embedded devices should be very short: Usually just setting a flag which will be read under the normal course of execution (e.g. in a task loop). This begs ...
SRobertJames's user avatar
  • 8,335
-1 votes
0 answers
15 views

Are there hardware prefetchers in Tiger Lake CPUs? If so, what are they? [closed]

I was looking through perf event list on i5-11400H processor and found that there are no events for hardware prefetchers. I looked up https://perfmon-events.intel.com/tigerLake.html and here too I ...
Sai Aravind's user avatar
-1 votes
0 answers
31 views

How can I understand that my processor, which I wrote with Verilog, is working correctly? [closed]

How can I understand that my processor, which I wrote with Verilog, is working correctly? Can I test this in any environment? I heard something like riscof. When I looked at it, I thought as if they ...
Kamer Kırali's user avatar
0 votes
0 answers
42 views

Details about Protection Ring system

I'm studying about Protection Ring system. Can you give me some details about operation of this system in CPU level? Is it related to CPL? why they use especially "4" level? why not 2 or 3....
choiyhking's user avatar
-3 votes
0 answers
31 views

Building cpu in software [closed]

(https://i.stack.imgur.com/TmKUf.png) I'm trying to create a CPU program with logic gates. I don't understand how to proceed with the program. I tried to understand what causes the output of the pc to ...
sasi shamtov's user avatar
0 votes
1 answer
35 views

Cache behavior in Tomasulo algorithm

Trying to implement Tomasulo, I have a fully associative cache (32 byte) with 16 byte block size. The cache is currently filled with a0, a1 (16b each) and LRU is a0. I am using branch prediction, ...
Andreas Christophilopoulos's user avatar
-3 votes
0 answers
20 views

Research paper in the domain of Computer Architecture [closed]

I am going to write a research paper (for my MS project) in any field in computer architecture for my college project. I am not able to finalize any topic. Pls let me know some ideas on which i can ...
Maximus Duke's user avatar
0 votes
0 answers
28 views

What is the difference between a cache stride, slice, set, block and line?

As per the title: What is the difference between a cache stride, slice, set, block and line? I tried looking it up but every source only explains some of the terminology. Either there is some overlap ...
traducerad's user avatar
0 votes
1 answer
18 views

Data loss when transferring data on one line use Mux/ DMux

I am studying about logic gates and I came across this diagram showing the uses of multiplexors and Demultiplexors in communications networks. Using Mux/ DMux in network communications In the ...
nady's user avatar
  • 1
2 votes
1 answer
37 views

The pipeline of add with lsl >4 in Neoverse N1

I have a question about the pipeline used by adds with shift (adds x3, x4, x5, lsl #32) in Neoverse N1, specifically adds x3, x4, x5, lsl #32. According to Neoverse N1 Software Optimization (https://...
aqjune's user avatar
  • 502
2 votes
3 answers
80 views

PCIe ordering rules and x86, how are they compatible?

PCIe specs express clearly what are the ordering rules. A Posted Request must not pass another Posted Request A Posted Request must be able to pass Non-Posted Requests to avoid deadlocks It means ...
Alexis's user avatar
  • 2,156
0 votes
0 answers
13 views

VM detection mechanisms for ARM

I'm currently developing a cross-platform VM detection library (for anticheat, not malware just to clarify) and I'm planning on adding cross-architecture support as well, specifically for ARM CPUs. I'...
BadUsernameIdea's user avatar
1 vote
1 answer
42 views

Do i really well interpret JMH results for synchronized counter and AtomicInteger

I wondered how much AtomicInteger is more performat then synchronized volatile increment in single-threaded environment, and write such a JMH Benchmarks: @OutputTimeUnit(TimeUnit.MILLISECONDS) public ...
Kurkazawar's user avatar
0 votes
0 answers
23 views

How to get current target architecture when building with Bazel platforms

I am cross compiling my native library for Android. My .bazelrc is: build:android --platforms=@io_bazel_rules_go//go/toolchain:android_arm64_cgo build:android --extra_toolchains=@androidndk//:all I ...
plamkata__'s user avatar
4 votes
0 answers
73 views

Why release sequence can only contain read-modify-write but not pure write

After a release operation A is performed on an atomic object M, the longest continuous subsequence of the modification order of M that consists of: Writes performed by the same thread that performed ...
TSK's user avatar
  • 615
0 votes
0 answers
36 views

Delay for writing data (if the data is not in the cache)?

Given the following code which is executed on x86-64 (other architectures do not matter here): #include <stdatomic.h> _Atomic int x; void g(int a) { atomic_store_explicit(&x, a, ...
Kevin Meier's user avatar
  • 2,349
1 vote
1 answer
32 views

How to judge if a given workload is hyper-thread friendly?

How do I tell if a certain working set is suitable for hyper-threading, other than just turning the hyper-threading option on/off and doing a direct performance test? There are two main problems: Can ...
Frontier_Setter's user avatar
0 votes
0 answers
35 views

How does the first benchmark ran always results in lower latency?

I have a multithreaded application for which I am trying to improve the performance by changing which threads should be bound to which cores. Firstly, I have some preprocessing step to figure out ...
avernus's user avatar
  • 314
2 votes
1 answer
58 views

Why do mem_load_retired.l1_hit and mem_load_retired.l1_miss not add to the total number of loads?

I'm investigating the effects of cache on performance on x86-64 CPUs. I've been using Linux's perf to monitor cache hit/miss rates, particularly these counters: mem_inst_retired.all_loads ...
MC ΔT's user avatar
  • 505
0 votes
1 answer
49 views

8086 microprocessor memory doubts, is external, if so how does segmentation actually occur

8086 is a 16bit microprocessor with a 20 bit address bus, this means that it can access upto 2^20 bytes of data. So my question is that if the memory is stored outside the microprocessor, thus the ...
Dhairya Gupta's user avatar
-1 votes
0 answers
35 views

How to figure out ctypes values sizes for python crossplatform app

I have a socket receiver (client/listener/etc), which collects bytes and fill the ctypes structure. Sender(host) - C language application, which send complicated C structure with nested arrays and ...
Mika's user avatar
  • 41
0 votes
1 answer
47 views

x86_64. How can I avoid memory dereferencing taking 390 processor cycles instead of 3.6 or at most 10 times more (36 cycles) instead of 100 times more

Trying to optimize concurrent linked lists access, I tried to benchmark the average time that dereferencing takes in x86_64 (my specific processor is a Ryzen). While I knew that the nice old days of ...
George Kourtis's user avatar
-1 votes
1 answer
27 views

Question on MRS Command and NOP Behavior in DDR3 Timing Diagram [closed]

I am currently studying DDR3 memory and am in the process of analyzing its timing diagrams. I am particularly intrigued by the section highlighted in red, which pertains to the MRS command. I have a ...
강영완's user avatar
2 votes
1 answer
124 views

What does word-size mean with greater size registers? [closed]

This question is since outdated so this is not a duplicate. We typically refer to 64 and 32-bit computers. Traditionally, that corresponded directly to register size (from my understanding) and was ...
user129393192's user avatar
1 vote
1 answer
121 views

Coherence protocol and store buffer

Consider the code below: std::atomic<int> a = 100; --- CPU 0: a.store(101, std::memory_order_relaxed); --- CPU 1: int tmp = a.load(std::memory_order_relaxed); // Assume `tmp` is 101. Let's ...
Jack Humphries's user avatar
0 votes
1 answer
44 views

Nand2Tetris: How to code 16-bit constant in ALU

I'm doing ALU task in Project 2 in Nand2Tetris course. // and operates on the resulting values, as follows: // if (zx == 1) set x = 0 // 16-bit constant // if (nx == 1) set x = !x // ...
user243557's user avatar
-1 votes
3 answers
66 views

How does source code become instructions in detail [closed]

I know about source code's path to become an executable instructions. Compilers, linkers, assemblers and etc. But everything happening in computer is happening in cpu. So when we write code, cpu ...
qukert's user avatar
  • 9
1 vote
4 answers
156 views

Why does creating a pointer of a local variable require the procedure to allocate space on the stack?

I was reading the third chapter of "Computer Systems: A Programmer’s Perspective." In the section "Local Storage on the Stack," the book says: Most of the procedure examples we ...
John Smith's user avatar
1 vote
1 answer
34 views

optimal to flush low-contention atomic from caches?

If I have some atomic variable which is accessed relatively infrequently (low contention) is accessed uniformly at random by threads/cores (i.e. if thread A writes to the variable, with high ...
ajp's user avatar
  • 1,767
2 votes
2 answers
137 views

Struct is padded to 8 bytes when 6 bytes seem sufficient

In the write-up The Lost Art of Structure Packing, the author introduces struct foo6 (...) in chapter 6 : struct foo6 { short s; char c; int flip:1; int nybble:4; int septet:7; }; ...
bdmt's user avatar
  • 21
0 votes
2 answers
37 views

Can execution units belong to same port work simultaneously?

According to Intel Skylake architecture figure, one port can be linked with multiple execution units. Can these units work simultaneously? For example, if an "integer vector multiplication ...
Frontier_Setter's user avatar
0 votes
1 answer
49 views

Golang Mechanical Sympathy and Critical Stride

I was going through "Mechanical Sympathy talk" by Teiva Harsanyi. https://www.youtube.com/watch?v=cetmDfqr2BU I am facing problem understanding the concept of Critical Stride. I understand ...
Tarun's user avatar
  • 3,162
-1 votes
2 answers
102 views

Is memory barrier after lock acquire necessary?

I have system with 3 CPUs sharing memory and bus. There is no cache in the system there are however store buffers. CPUs have Compare And Swap (CAS) instruction available that is atomic. Additionally ...
user1806687's user avatar
2 votes
2 answers
100 views

The PAUSE instruction may not work in my test

the detail of test program I tested it in user mode using examples from Intel SDM, The details of this test are as follows: Provide an global lock using SystemV shared memory for multiple processes ...
wang fuqiang's user avatar
0 votes
0 answers
30 views

How is it possible to turn 0,1 machine language data into 0v or 5v for transistor inputs? [duplicate]

How is it possible to turn 0,1 machine language data into 0v or 5v for transistor inputs? Now I'm learning how a software connect to a hardware. I understand a CPU use logic circuits.   Logic circuits ...
Takeshi's user avatar
  • 59
1 vote
1 answer
65 views

Assembly instructions showing how zenbleed was found

While looking at this zenbleed article, it was found that a randomly generated sequence of instructions and the same sequence but with randomized alignment, serialization and speculation fences added ...
vengy's user avatar
  • 1,742
0 votes
1 answer
42 views

How can I do a step-by-step tracing on amd-v(svm)?

Introduction: I can't figure out how I can do a trace on an amd hypervisor. Is there something like eflags.tf in svm? so that I can trace the instructions Main problem: I initially thought that amd ...
Barbosso's user avatar
1 vote
1 answer
24 views

Why mcyclecfg and minstretcfg is needed?

In RISC-V, new CSRs are planning to be added. This is the documentation on Github Page. It is addressed to two problems below. • It introduces unpredictable noise to the counter values observed by ...
Ömer GÜZEL's user avatar
5 votes
0 answers
71 views

Does the SERIALIZE instruction prevent speculative execution?

Recently came across the SERIALIZE instruction. Serializes instruction execution. Before the next instruction is fetched and executed, the SERIALIZE instruction ensures that all modifications to ...
vengy's user avatar
  • 1,742
0 votes
0 answers
29 views

Does QEMU RISCV system emulation emulate tlb cache? [duplicate]

I have been playing around with this blog-post https://colatkinson.site/linux/riscv/2021/01/27/riscv-qemu/ and after booting up the machine with this command: qemu-system-riscv64 \ -machine virt \ ...
grigorism_'s user avatar
0 votes
1 answer
38 views

Why am I able to run this image on arm64?

As I am on Mac 1, I figured I would get an error attempting to "docker run" this image but I don't. It was built calling make build, make image, and then it was pushed to the remote. ...
vmayer's user avatar
  • 985
3 votes
1 answer
74 views

Is cache coherency required for memory consistency?

Cache coherency deals with read/write ordering for a single memory location in the presence of caches, while memory consistency is about ordering accesses across all locations with/without caches. ...
Nimish Shah's user avatar
0 votes
0 answers
21 views

Do context switches in the kernel include code to save the context of the floating point as a general rule of thumb? [duplicate]

I'm new to Kernel coding and have been going through the LINUX DEVICE DRIVERS book. Here's an excerpt from the book: Kernel code cannot do floating point arithmetic. Enabling floating point would ...
Sathvik Swaminathan's user avatar
0 votes
1 answer
58 views

Errors in my x86 code for my Assembly Language Project

Please fix the following errors in the following lines of code. I am using x86 code with the Irvine files in Visual Studio: Line 98 in my program I have the error A2032 "Invalid use of register&...
Saviorr's user avatar
  • 11
2 votes
1 answer
86 views

Why does x86 ldmxcsr/stmxcsr take a memory operand?

In x86, there is no way to directly set or store the MXCSR register from a general-purpose register. Forcibly encoding a register operand leads to #UD. This seems rather inefficient when the main use ...
Ovinus Real's user avatar
3 votes
0 answers
73 views

Why is this function running slow for a specific environment size? [duplicate]

In their well-known paper Producing Wrong Data Without Doing Anything Obviously Wrong! the authors discuss the effect of code layout in memory on a program's performance. In particular, they analyze ...
ConfusedProgrammer's user avatar
0 votes
0 answers
41 views

GNU assembly. "Movq %rsp, %rax" is assembled into a only 3 byte binary. Not 8 byte.Why? [duplicate]

I use the GNU assembly on 64 bit processor. I assemble the following code movq %rsp,%rax After that, I do a objdump on the binary code. And I got the following: 401000: 48 89 e0 mov ...
Towa's user avatar
  • 1

1
2 3 4 5
81