Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/31/07 18:42
Read: times


 
#148865 - What I think about your project doesn't matter
Responding to: ???'s previous message
Russ Cooper said:
Richard said:
I'm not so "into" implementation details as Andy, but I am concerned about your architecture.

Richard,

I've read your many posts on this subject multiple times. From what I can tell, the only concern you've expressed about my approach is that it's different than the way you would do it.

Although you've never said so directly, I have guessed that your approach follows from an assumption that hardware is expensive and that it's therefore very important to minimize the amount of silicon used. As I have stated at least once, I am not so worried about that. I'm more interested in striking a happy balance between performance and simplicity. So it's no surprise that our two approaches differ.

Yes, I've been concerned that it's easy to reach that conclusion. My main concern, however, is not for conservation of silicon resources, but for conservation of effort. Hardware is expensive, particularly if you're headed for production, since you have to ship the hardware with every product, while software is "just a $0.12 CD." Once you've decided on a set of hardware, e.g. on a specific FPGA, whether a hobby project or a production target, the cost becomes fixed, so that's not a problem any longer.

As with anything, there are multiple ways of going about doing this thing. I've looked at, though not thoroughly understood your diagrams, etc, and that, as much as anything, has persuaded me that you're overlooking a much simpler approach. OTOH, I don't want to tell you how to do your task, particularly since it's a learning exercise. The more I attempt to direct your effort, the less learning opportunity you have.

For at least three decades, the thrust in design methodology has been toward "top-down" design. When first exposed to the distinction between "top-down" and "bottom-up" design strategies, one is tempted to say, "It's obvious what's better!" but it's more subtle than that. Bottom-up design is not just a matter of saying, "Well, the boss got a good deal on JK flipflops last week, so that's what we'll use ..." as one is often told in school.

At the risk of oversimplifying, I'd have to say that "top-down" methods require that one look at the entire problem and devise a single solution that addresses all the requirements one is trying to meet. "Bottom-up" methods tempt one to look at the tools and skills one has and think about how one can use those to address the various requirements of the problem.

My comment, early on, that you can use the same ALU to operate on address objects that you use to operate on data objects seems to have forced you to believe that all I'm thinking about is saving a gate here and a gate there. While it's easy to reach that conclusion, that's not what I'm thinking at all. The fact that I pointed out that it saves logic otherwise required for those long and complex counters, which seem so simple in the context of "SP--" or "++DPTR," was more of an effort to show you that you'd then have less complexity in your hardware design. I've tried to suggest that one can view this MCU core, and, in fact, nearly
any
MCU core as a set of resources demanding output, a set of resources providing input, an ALU that preforms the necessary operations on inputs and outputs, and a set of control logic that prepares and steers the logic paths between all the resources.
If you design a

With that in mind, let me ask you this: Instead of vaguely expressing your "concern" about what I am doing, could you please identify those specific aspects of my design that you see as flawed, so that I have half a chance of considering them and possibly correcting them sooner than later?


This is really difficult, as I see the flaws, if there are any, as being at the very top, namely in the method with which you've approached the task. The implementation details you've mentioned have supported this concern. It seems as though you're designing an engine that does a few things and then simply "hang a bag on it" for each additional operation. This is a common "software" approach, which can be made to work quite seamlessly in software, but often doesn't work out so well in hardware. That's why I've occasionally cautioned you about attempting make the hardware internals look too much like the software externals, i.e. make the hardware track the behavior of the MCU as viewed from its instruction set and how it executes it. This is a symptom of bottom-up thinking.

One thing that you probably haven't considered, is that you could, if you wanted, structure your code memory as byte-addressable, but long-word (32 bits) wide. That allows you to access all three bytes of a long instruction concurrently, and, therefore, to execute the entire instruction in one cycle, fetching and decoding the next opcode concurrently with the execution of the current one. The same is true for two-byte instructions, which are the ones most often used, right? The consequence of this sort of operation is that your PC has to be incrementable by 1,2,3 or 4. The ALU probably has an adder/subtractor quite capable of doing that if it's extended to be wide enough. That is, however, the sort of thing with which a habitual "bottom-up" thinker (like me) has to be very careful.

Comments such as "the Harvard architecture cries out for concurrent access to code and data space..." or whatever it was you said along those lines, is another example of a "bottom-up" view, which is also reflected in the diagrams and charts you presented.

Bottom-up strategies lead to a very quick and often promising start, while top-down strategies lead to a timely completion. Bottom-up strategies can, not always, but often, lead to a "blind alley." Top-down methods will not. This is because "top-down" methods require that the design be complete before an implementation can be devised. Block diagrams with empty blocks, and charts with missing elements suggest that's not been done.

Thanks,

-- Russ



I hope I haven't just "muddied the water" with these comments, but, I'm serious about not overly driving your effort. Initially, I figured you'd had some experience with CPU design, and were just trying to start learning Verilog. Apparently, you've got to learn a bit more about rigorously structured hardware design, too. Then, too, there's the problem of devising a design targeted at FPGA, which is something I'm still trying to learn, and then there's the business of expressing that design in Verilog, VHDL, ABEL, schematics, or whatever.

Your suggestion of using clocks in a certain way suggests that you've decided, IMHO prematurely, how the core operation should be timed. If you're going to use a multi-clocked approach, I'm persuaded that the clocked elements should be pipeline registers used to speed things up, at the cost of added latency. That's why I lean toward a single-cycle solution rather than a multi-clocked one. Once you have a single-cycle solution firmly in mind, you can speed it up with pipelining.

It's like Andy has repeatedly said, "If this were easy, everybody would do it." The numerous "rubbishware" examples, in the form of partially functional, only partially complete, insufficiently documented, and nearly-impossible-to-understand cores in the public domain should have convinced you that it's not as easy as it looks.

This thing's getting a bit long, and I've had a number of interruptions ... so I think I'd best hold off on adding any more "grist for the mill."

The main thing is that I don't want to drive your project. I'm just seeing things I've seen in countless meetings over the past 40 years, where designers anxious to produce results have started coding/soldering/wiring/ordering before each and every requirement is fully spelled-out and rigorously addressed. I hope you won't fall into that trap.

RE


List of 282 messages in thread
TopicAuthorDate
Let's make a '51!            01/01/70 00:00      
   ???            01/01/70 00:00      
      Maybe yes...            01/01/70 00:00      
         Still digging!            01/01/70 00:00      
            re above            01/01/70 00:00      
               digging deep            01/01/70 00:00      
                  It depends on your goal            01/01/70 00:00      
         Thanks            01/01/70 00:00      
   a simulation which actualy works            01/01/70 00:00      
      clockwise            01/01/70 00:00      
      Not Nesasarily            01/01/70 00:00      
   WHAT?            01/01/70 00:00      
      Yeah, C...            01/01/70 00:00      
   From reading the subject title...            01/01/70 00:00      
      verilog to c            01/01/70 00:00      
         FpgaC            01/01/70 00:00      
            there are more similar            01/01/70 00:00      
            re :FpgaC            01/01/70 00:00      
               it's just as with any other C...            01/01/70 00:00      
   Step1: Program Counter, code fetching...            01/01/70 00:00      
      finite state machine            01/01/70 00:00      
      Step 1 1/4: the byte counter&some more infrastruct            01/01/70 00:00      
         Step 1 1/2: first problems            01/01/70 00:00      
            Why not do this ...            01/01/70 00:00      
               reset in a dozen of ways            01/01/70 00:00      
                  It\'s really simple and stupid            01/01/70 00:00      
                     Faking out the LJMP            01/01/70 00:00      
                        You can't have it both ways ...            01/01/70 00:00      
               To IOR or not to IOR            01/01/70 00:00      
                  it's probably a logic reduction            01/01/70 00:00      
                     TRANSPARENT latch?            01/01/70 00:00      
                        Using clocked registers requires multiple clocks            01/01/70 00:00      
                        How to build an oscillator            01/01/70 00:00      
                           it's simple, but not THAT simple            01/01/70 00:00      
                              Where does the IOR belong in my picture?            01/01/70 00:00      
                                 You've got to have a complete picture.            01/01/70 00:00      
                                    Thanks            01/01/70 00:00      
                                       much depends on how you perceive it            01/01/70 00:00      
                     To IOR or not to IOR            01/01/70 00:00      
                        By all means, let\'s see what you think should work            01/01/70 00:00      
                           I don\'t know how I would do it            01/01/70 00:00      
                              Why do you think it\'s a lot of logic?            01/01/70 00:00      
                                 maybe later I will arrive to the LJMP            01/01/70 00:00      
                                    It is only one of a number of options.            01/01/70 00:00      
                  to reset or not to reset            01/01/70 00:00      
                     Not so fast, there, Pilgrim ...            01/01/70 00:00      
      Is there a picture?            01/01/70 00:00      
   Simulator            01/01/70 00:00      
      well, maybe...            01/01/70 00:00      
         The question is one of what you\'re simulating            01/01/70 00:00      
   Opportunity            01/01/70 00:00      
      How about this?            01/01/70 00:00      
         Thaks            01/01/70 00:00      
      not this time...            01/01/70 00:00      
         VHDL vs C            01/01/70 00:00      
            Where you sit (and when) determines what you see            01/01/70 00:00      
               ABEL is now available free            01/01/70 00:00      
               VHDL verbosity            01/01/70 00:00      
                  Entering everything more than once is not safety            01/01/70 00:00      
                  That\'s exactly what it is!            01/01/70 00:00      
                  on tools etc.            01/01/70 00:00      
                     You could, of course, use schematics ...            01/01/70 00:00      
   some basics from the wikiwhatever            01/01/70 00:00      
      Caution is indicated            01/01/70 00:00      
   What's your goal?            01/01/70 00:00      
   Step 2: The ticks counter (and the promised bonus)            01/01/70 00:00      
      BOTTOM-UP vs TOP-DOWN DESIGN            01/01/70 00:00      
   I am stuck            01/01/70 00:00      
      Prototype the ALU?            01/01/70 00:00      
         it's still hard            01/01/70 00:00      
            Jan, if you like \"bottom-up\" ...            01/01/70 00:00      
               I\'ve added a simulation            01/01/70 00:00      
      Maybe you should complete the design            01/01/70 00:00      
   step 2 1/2: MOVCs and JMP @A+DPTR            01/01/70 00:00      
      Design, then implement???            01/01/70 00:00      
         the gross picture            01/01/70 00:00      
            To the C hater            01/01/70 00:00      
               pictures and amusement            01/01/70 00:00      
                  it\'s probably not as amusing ...            01/01/70 00:00      
                     hummmm....            01/01/70 00:00      
                        that is what you have to explore            01/01/70 00:00      
                  ...and this isn\'t very amusing either            01/01/70 00:00      
      Well, this is YOUR game ...            01/01/70 00:00      
         the simplest way            01/01/70 00:00      
            ... there are many ways...            01/01/70 00:00      
               indeed, there are many ways ... BUT ...            01/01/70 00:00      
               re: there are many ways            01/01/70 00:00      
               re: microcoded MCU's            01/01/70 00:00      
                  not really microcoding...            01/01/70 00:00      
                     where there's a will ...            01/01/70 00:00      
                     constraints            01/01/70 00:00      
                        yes, but there's certainly a lower bound...            01/01/70 00:00      
                           lower bound?            01/01/70 00:00      
                              achievable minimum            01/01/70 00:00      
                           lower bound?            01/01/70 00:00      
                              perhaps what he means is a minimal delay            01/01/70 00:00      
   the rough picture            01/01/70 00:00      
      Now, this is YOUR project ... but ...            01/01/70 00:00      
         this is what I am talking about - relative cost            01/01/70 00:00      
            try to benefit from prior art            01/01/70 00:00      
         sorry - double post            01/01/70 00:00      
      I like the new picture            01/01/70 00:00      
         it's ugly            01/01/70 00:00      
            There is no requirement for beautiful drawings            01/01/70 00:00      
            Just sketch and scan ...            01/01/70 00:00      
               Early drawings should be ugly and disorganized.            01/01/70 00:00      
                  I'm not just being contrary, BUT ...            01/01/70 00:00      
                     maybe this is the way how a stupid programmer...            01/01/70 00:00      
                        Too much emphasis on art, not enough on science            01/01/70 00:00      
                     You ARE contrary, but we love you anyway.            01/01/70 00:00      
               is this simulation of this circuit?            01/01/70 00:00      
                  YES!            01/01/70 00:00      
               correction?            01/01/70 00:00      
                  there are certainly 254            01/01/70 00:00      
                     I may be reading something incorrectly            01/01/70 00:00      
                        whoops, double post again, sorry            01/01/70 00:00      
                        try mine            01/01/70 00:00      
                           did you notice the redundant opcodes?            01/01/70 00:00      
            If you like, you can use PAINT!            01/01/70 00:00      
               GIF            01/01/70 00:00      
                  this is not available as a default option...            01/01/70 00:00      
   detour - QR6, and how to explain my ideas...            01/01/70 00:00      
      ???            01/01/70 00:00      
         read one-by-one...            01/01/70 00:00      
            Too late!            01/01/70 00:00      
      Why the context switch?            01/01/70 00:00      
         simplicity            01/01/70 00:00      
            They're unrelated            01/01/70 00:00      
               sure they are unrelated....            01/01/70 00:00      
                  Maybe it\'s just grapho-semantics            01/01/70 00:00      
                  I'm a little confused            01/01/70 00:00      
                     this is not meant to be useful...            01/01/70 00:00      
                     Now I see!            01/01/70 00:00      
                        What's next?            01/01/70 00:00      
      MHO            01/01/70 00:00      
         Correction            01/01/70 00:00      
      One thing I missed ...            01/01/70 00:00      
         yes, and...            01/01/70 00:00      
            pre-ANSI K&R            01/01/70 00:00      
               yes, thanks            01/01/70 00:00      
            Here\'s the K&R chapter            01/01/70 00:00      
   Let\'s make a \'51 core            01/01/70 00:00      
      I like it...            01/01/70 00:00      
         The diagrams are now updated            01/01/70 00:00      
            I thought this is the case...            01/01/70 00:00      
               Bit ops, duplicated registers, and PSW            01/01/70 00:00      
                  I\'d not push SFR into \"internal memory\" at all            01/01/70 00:00      
                     Maybe yes, maybe no            01/01/70 00:00      
                        Certainly no.            01/01/70 00:00      
                           No, certainly            01/01/70 00:00      
                  careful now!            01/01/70 00:00      
                     OT: will there be cheap FPGAs?            01/01/70 00:00      
                        Check ther prices!            01/01/70 00:00      
                           the cost...            01/01/70 00:00      
                              Distributed over the cost of trillions of IC's            01/01/70 00:00      
                     Size vs. Performance            01/01/70 00:00      
                        I think you should do it your way ...            01/01/70 00:00      
                           Bad assumption on my part???            01/01/70 00:00      
                              this is how we see a RAM            01/01/70 00:00      
                                 by way of clarification            01/01/70 00:00      
                              keep instruction set and its implementation apart            01/01/70 00:00      
                                 ???            01/01/70 00:00      
                                    I see what you mean            01/01/70 00:00      
                                       I've almost got it now            01/01/70 00:00      
                                          dunno            01/01/70 00:00      
                                             Dedicated RAM vs flip-flops for SFRs            01/01/70 00:00      
                                          It should have a purpose, should it not?            01/01/70 00:00      
                                             '51 registers R2-R7 are no different...            01/01/70 00:00      
                                                BUT ... he referred only to R0 and R1 ...            01/01/70 00:00      
                                                It\'s all in the approach            01/01/70 00:00      
                                             It does have a purpose            01/01/70 00:00      
                                          Correction            01/01/70 00:00      
                                             I don't think it's impossible...            01/01/70 00:00      
                                                FPGA RAMs            01/01/70 00:00      
                                                   I think I understand that...            01/01/70 00:00      
                                                      It is probably not so easy            01/01/70 00:00      
                                                      bit-split the BRAM            01/01/70 00:00      
                           I think this horse is finally dead            01/01/70 00:00      
                              Be careful not to fool yourself            01/01/70 00:00      
                                 Nobody is fooling anybody            01/01/70 00:00      
                                    Not exactly what I was after, but helpful            01/01/70 00:00      
                                       Out of curiosity, what were you after?            01/01/70 00:00      
                                          I want to understand your approach            01/01/70 00:00      
                                    I try to keep an open mind ...            01/01/70 00:00      
                              dead horses couldn't drag me away            01/01/70 00:00      
                                 A ewe's my aunt            01/01/70 00:00      
                                    You can force the structure to be what you want            01/01/70 00:00      
                                       schematics vs HDL, round 666            01/01/70 00:00      
                                          It's about the money.            01/01/70 00:00      
                                       schematic entry            01/01/70 00:00      
      You may be surprised at how easy it is            01/01/70 00:00      
         It doesn't look too difficult yet ...            01/01/70 00:00      
            different strokes for different folks            01/01/70 00:00      
      Oops - duplicate post            01/01/70 00:00      
   My two cents .. How about Duo/Quad core 8051            01/01/70 00:00      
      Not as simple as that            01/01/70 00:00      
         Just a thought            01/01/70 00:00      
            Exactly!            01/01/70 00:00      
         It's like using a team to do a job            01/01/70 00:00      
            more troubles with multiprocessor...            01/01/70 00:00      
               8051 multi-cores            01/01/70 00:00      
                  Writing code for them would be "interesting" too            01/01/70 00:00      
                  Isn't a '51 core too expensive for this?            01/01/70 00:00      
                     \'multicore\'            01/01/70 00:00      
                        it all depends on the application            01/01/70 00:00      
                           this is not pantyhose            01/01/70 00:00      
                              sure...            01/01/70 00:00      
                     Cost of an 8051 core            01/01/70 00:00      
                        that sounds like pretty expensive to me...            01/01/70 00:00      
               efficiency will surely increase            01/01/70 00:00      
                  How can that be?            01/01/70 00:00      
                     How can that be?            01/01/70 00:00      
                     maybe not "more efficient"            01/01/70 00:00      
                        it might be clever to use a different architecture            01/01/70 00:00      
                           it always MAY be            01/01/70 00:00      
      there are other ways...            01/01/70 00:00      
      One task per CPU is good            01/01/70 00:00      
         you nailed it Russ            01/01/70 00:00      
         that is where things tend fo fall apart            01/01/70 00:00      
   New subtopic - How to initialize block RAM?            01/01/70 00:00      
      there once was a ROM primitive            01/01/70 00:00      
      Initializing BRAMs            01/01/70 00:00      
         re: Initializing BRAMs            01/01/70 00:00      
            re: Initializing RAMs            01/01/70 00:00      
   Update: How the execution unit works            01/01/70 00:00      
   Yet another Verilog question            01/01/70 00:00      
      Yet another Verilog answer            01/01/70 00:00      
         Yet another Verilog thanks            01/01/70 00:00      
            why ... ?            01/01/70 00:00      
   Yo! --- Andy ---- about those fast-carry muxes ...            01/01/70 00:00      
      fast-carry muxes            01/01/70 00:00      
         It's not that simple ...            01/01/70 00:00      
            well ... i don't know.            01/01/70 00:00      
               It depends on what they can do ...            01/01/70 00:00      
                  Now I'm confused.            01/01/70 00:00      
                     it\'s just a documentation issue            01/01/70 00:00      
   Update: Implementation is underway            01/01/70 00:00      
   Update: How to handle C, AC, and OV flags?            01/01/70 00:00      
      there are a couple of ways ...            01/01/70 00:00      
         Can you be more specific?            01/01/70 00:00      
            What I think about your project doesn't matter            01/01/70 00:00      
               Re: what you think doesn't matter            01/01/70 00:00      
                  Now ... please don\'t take this as personal ...            01/01/70 00:00      
                     Okay            01/01/70 00:00      
               if you insist on using schematic entry            01/01/70 00:00      
                  If only it were that simple            01/01/70 00:00      
      you can do it "symptomatically"... but I wouldn't            01/01/70 00:00      
         More on the flags            01/01/70 00:00      
            wrong place ... sorry!            01/01/70 00:00      
      Very ungracefully            01/01/70 00:00      
      Historically...            01/01/70 00:00      
         The key, IMHO, is in the number of data paths            01/01/70 00:00      
            ... or ...            01/01/70 00:00      
               in low production, maybe            01/01/70 00:00      
                  this depends on approach            01/01/70 00:00      
               uC prototyping using FPGAs            01/01/70 00:00      
                  what challenge?            01/01/70 00:00      
         re: Historically            01/01/70 00:00      
            the REAL learning is in what synthesis tools do            01/01/70 00:00      
               Indeed            01/01/70 00:00      
                  xilinx synthesiser and others            01/01/70 00:00      
                  tedium ... yes, that's what it is ...            01/01/70 00:00      
   Update - the core now runs on the FPGA            01/01/70 00:00      
      How much code space does it support?            01/01/70 00:00      
         Re: How much code space does it support?            01/01/70 00:00      
            How about a testbench?            01/01/70 00:00      
               Good ideas            01/01/70 00:00      
            some ideas            01/01/70 00:00      
               Please clarify            01/01/70 00:00      
                  make it vonNeumann...            01/01/70 00:00      
                     I still don\'t get it            01/01/70 00:00      
                        let's not complicate things            01/01/70 00:00      
                           Re: let's not complicate things            01/01/70 00:00      
                              I'm not sure why you'd want to do that ...            01/01/70 00:00      
                              a way how to leave problems to somebody else            01/01/70 00:00      
                                 Von Neumann            01/01/70 00:00      
                              test code            01/01/70 00:00      
                                 Thanks            01/01/70 00:00      
                        Thanks ... it\\\'s clear now            01/01/70 00:00      
      8501 self tests            01/01/70 00:00      
      Another (minor) update            01/01/70 00:00      
         you need external bus            01/01/70 00:00      

Back to Subject List