On Tuesday, December 20, 2016 at 6:16:31 PM UTC-5,
thomas....@gmail.com wrote:
> @Rick #1: I am by no way a cache expert, but still some random notes:
> - I had a hard time to understand your drawing - either because I am too stupid, or because it works differently than I would expect. Nevertheless:
I have never done anything like this before. To be honest, it kind of
"revealed itself" to me as I was designing it. I began with a portion
of the image, which did some function, and then I would have the thought
in the back of my mind how the next portion would go, and so on. The
end result is that image. I did not particularly plan it to turn out
that way, it's just how it came forth.
> - It looks like you access your memory byte-wise. This is of course much too slow if you want to have 40b input/output data finally.
What you see there in the middle is a byte cell. It holds the smallest
directly addressable quantity of memory my CPU will uniquely address (an
8-bit byte). However, you'll note in the top and bottom of the central
cell there are four write (top) and four read (bottom) ports. These
deposit into a 40-bit bus. Each individual byte takes up its slot in
the bus, so that each cell is assembled with other cells to the right
and left in the cache line to create the entire 40-bit quantity.
The cache request circuitry for reads (not shown directly in the image)
wire into the connections indicating which portions of the 8-bits in
the cache cell enter into which portions of the four 40-bit buses
You can see the aggregation of buses in this other image:
Here you see the 128-byte cells per cache row, and the addresses
required to address the data within the cell, as well as the
overflow of addresses in a prior memory range:
https://raw.githubusercontent.com/RickCHodgin/libsf/master/arxoda/arxoda-documentation/images/cache_l1/cache_line.png
The buses along the left show how the data is connected logically.
There are four 40-bit write buses coming in, four 40-bit read buses
coming out, two 64-bit main memory buses (which can be connected to
an L2 rather than directly to a main memory controller buffer), as
well as inputs for incoming addresses.
One feature not directly shown is a way to setup the cache metrics.
I haven't yet finalized how I'm going to do that, but basically it
allows add and subtract operations on the cumulative saturating count
in the middle-right. I believe that logic needs to be moved to a
row-wide metric rather than a cell metric. However, by keeping it
as a cell metric it would allow for metrics to be established based
on heavy hit usage areas, such that single-reads, dual-reads, tri-
reads, and quad-reads to individual cells, all affect the weight of
the data in the cache more or less than do other operations (and the
same for writes and also non-activity).
At first glance, I am thinking that every read and write will increase
the count by 2^n, where n is the number of hits per cell (or per row
if I move it out), and every every non-access will decrease it by one.
> (The opposite could be a better strategy: Read/Write 80/160/320b in parallel.) When high-end CPUs have a latency of e.g. 3 clocks, this is only because of the high clock-speed, not e.g. because the access the cache 3 times for one access.
I'm not sure how to do this in a way that is faster. I would like to do
it asynchronously, and I've considered paths which take a conservative
estimate of the longest wire lengths and maximum path through gates so
that I have a parallel operation which is conducted, with some extra
padding added on for safety, which then signals when the operation
should've been completed in raw switch-speed time, which then completes
and waits for the next bus cycle to populate the data onto the bus for
that duration. I've considered a double-pumped, tri-pumped, or quad-
pumped clock, etc.
For now, I want to get it working in simulation, and in my Altera FPGA
to see if it will even operate.
> - In some points your drawing is very detailed (gates, individual data lines drawn), some others are higher level, but the meaning is not clear to me (e.g. "cache metric decoder")
> - I have not seen a hit/miss detection?
The data returned by the cache cells populates onto their bus slot within
the request, and will either fully populate the portions expected, or not.
That will give the hit/miss determination. In my current thinking, it is
a one clock latency to determine a hit or miss per cache line (there are
four reads per clock possible, and suppose three were issued, and one of
those failed and two succeeded, each would know after one clock cycle if
it succeeded or failed).
> Regards,
> Thomas
Thank you for your response, Thomas. I'll make a video giving a
description outlining the design later on tonight. Right now, I'm
altering some pants for my wife. :-) She's going on vacation and
has some modifications needed.
-----
I understand your #2 point ... but when your eyes have been opened
to eternity, and you realize what's required to enter in, and the
people around you (those you care about the most) are not on the
path to enter in ... it's very difficult to think of other things.
I continue on in my daily work, but I try with great passion and
persistence to come up with new ways of teaching and explaining
the need we have to be forgiven. It may not seem important now,
but now only lasts for a tick of the clock, and then "then" begins.
And whereas now is terminal, then is not terminal. Now yields.
Then never yields. Considering what that truly means to living,
breathing people and their eternal souls ... it's too much for me
to remain silent on.
To put my life in perspective: I currently have zero friends.
Zero family that tolerates me, save my immediate family. Zero
neighbors who want anything to do with me. And very few church
members who regard me positively. My ongoing urging toward closer
walks with the Lord and Savior push nearly everyone away ... because
it is a very real thing that we know deep down we need. It is the
anti-Christ spirit at work in this world which pushes people away
from me because it's trying to keep the people already on the wide
path to destruction away from hearing the truth, because if they
were to ever hear the truth they would know it is the truth and
they too would come out from the deception, repent of their sin,
ask forgiveness, and be saved.
I do not have people in my life who seek me out. I have co-workers
who respect my abilities, but keep me at or beyond arm's length.
I have people who contact me with prayer requests when things begin
to fall apart in people's lives. I have even my immediate family
who wrestles with me at least three out of seven days a week, and
in enough of a form that it affects the entire evening, or even the
entire day.
It is not for nothing that I post these things. My heart was changed
in 2004. I have experienced the transformation, and the lives at
stake here in this world mean something to me. I have personal
interests in things like computers (software and hardware design),
and I pursue those things, but all of it is now tempered with my
faith, which (to be honest) has surprised me completely.
I used to know Rick pretty well before I met Jesus Christ in 2004.
But when I met Him, and I believed, and I asked forgiveness, I really
did change on the inside, which has reflected out to the outside. I
tried to run away from the faith, I tried to fall back into my old
tendencies, etc., but the conviction is real, the guidance of the
Holy Spirit is real. Jesus is called "The Good Shepherd" in scripture,
and He does come after His lost sheep, to guide them back to where
they should be.
A famous Christian comedian has said that God is like a GPS device.
When you make a wrong turn, He doesn't abandon you. He simply re-
calculates, to get you from where you now are to where you should be.
It's a perfect description of how Jesus guides a born again believer's
life. And as I go through each of my days considering the importance
of the people around me, their amazing value as the most beautiful
creations I've ever seen in my entire life (just sit and watch people
interact sometime, watch them do things, watch them play football or
read a book or look over their kid's homework, etc.), then my heart
rattles from within with a real desire to teach them that which they
need to be saved, so that they too can continue on in eternity, as
even more beautiful creations once we are stripped of this limited
sinful flesh.
I know it's difficult for people. I could not receive it for the
first 34 years of my life. But very near to my 35th birthday I did.
And I know for all who will be saved there will come a day. And it
is for that day for each of them that I labor, and indeed it is the
reason why all Christians labor. We are laborers sent out into the
harvest fields to reap what is reapable. We are fishermen, now
knowing if we will catch anything, but still casting out so that the
possibility always exists.
My heart cries out from within, and whereas I have interests like
this CPU project, and my operating system, and the apps which will
run on top of it (compilers, office suites, email, browsers,
everything), none of them are isolated from my heart crying out for
people to be saved. The two work together, which is what God intended
for those who are His. We go about our affairs in this world, but we
keep Him out in front of what we do, permeating what we do, always
sprinkling the things we do with knowledge of Him, knowledge of His
Son, knowledge of sin, knowledge of His call on each of us to repentance,
and more.
It is from there I proceed.