10.21.2016

UVM's community process could use some upgrades

Overall, UVM is a net benefit to my job. Having a standard base class library makes it easier to create reusable test benches quickly. The API has been submitted to the IEEE for standardization, which should encourage even more use in the ASIC industry. However, the development of the reference implementation is woefully mis-managed.

Let's take a look at some of my favorite issues in the Accellera Mantis database for UVM:

  • uvm_reg_map::clone doesnt clone, doesnt emit a message and silently returns NULL

    This one is pretty self descriptive. Being able to clone a register map would be extremely useful when several physical ports all share the same set of registers - the default map could be cloned and associated with a port. However, as the summary for this issue says, clone() does not work. Why does it not work? Well, here's the text of the method, as currently implemented:
    function uvm_object uvm_reg_map::clone();
        //uvm_rap_map me;
        //me = new this;
        //return me;
        return null;
    endfunction
    
    No further comment necessary.

  • uvm_heartbeat does not respect the comps list

    This one is a bit more esoteric, but it has been an issue for me when trying to use the uvm_heartbeat class. Helpfully, the reporter also attached a proposed fix, but it does not appear the fix has been accepted. The reporter's name has been struck out (perhaps the account is no longer active?) and the issue labeled 'errata'. I do not think that is the appropriate classification for an issue like this.

Now, I am definitely not the first one to notice how buggy the reference implementation is. The topic first came to my attention when I saw a talk at SNUG 2014. The paper itself is behind a Synopsys login (of course), but a summary of the concerns is available. The authors have done a great job of creating a project to unit-test the UVM library, but that's only half the battle. If bugs are discovered and reported, someone still has to fix them, and as the bugs above show, that's just not happening.

In a better world, the UVM reference implementation would be run more like most open source projects, where pull requests to fix issues could be submitted and reviewed in a timely manner. These fixes would be aggregated in smaller point releases more often, with something like UVM-UTest giving users confidence that regressions will be caught. In the meantime, fixes for long-standing bugs are only available by manually patching your local copy of the framework, which is obviously not ideal.

I understand that maintaining a large, complicated framework like this is hard, and I am not claiming I could do better. I am suggesting that adopting proven methods for managing an open framework like this could reap huge benefits.

Anyone else have some hilarious (or sad) bugs that have lived on for too long?

8.14.2016

Using py.test with Django and Hypothesis

If you're looking to use py.test as your test runner, but still want Hypothesis to correctly work with Django (i.e. make sure the database is in a clean state before each example is tested), use something like this:

class PytestHypothesisBase:
    def start_atomic_example(self):
        self.atomic = transaction.atomic(savepoint=True)
        self.atomic.__enter__()

    def setup_example(self):
        self.start_atomic_example()

    def finish_atomic_example(self):
        transaction.set_rollback(True)
        self.atomic.__exit__(None, None, None)

    def teardown_example(self, ex):
        self.finish_atomic_example()

Hypothesis will run setup_example and teardown_example even when using py.test. This is nice because while inheriting from hypothesis.extra.django.TestCase works with py.test, it causes dependency injection to break, meaning you can't use py.test's nice fixture behaviors. This approach lets you use the @given decorator with py.test fixtures.

7.15.2013

Deck upgrade

I decided to replace the stereo in my car. The head unit I had in there was great in 2004, and had nice (for the time) iPod integration. Fast forward a few years, though, and all the small protocol tweaks meant my stereo would not talk to my iPhone 5. Consequently, I have been listening to the radio and the new Vampire Weekend album for the last three months. 
This is the old unit. It's an Alpine, model number CDA-9833. She's been a workhorse, but it is time for retirement. 

This upgrade also gives me a chance to fix this broken control panel. This big crack on the left side of the HVAC controls prevented my stereo from staying securely in place. Lots of wiggle. 

Here's the mess of wires behind the head unit. The clock unit, dangling on the right, is easily removed and provides some access while working in this area. 

Here is Rory. His help was invaluable. It's just a coincidence that he has food in this picture. 

Trying to remove the frame that held the old unit. You can see some of the numerous forks that have a slight bend in them. Putting the frame in place means those forks will slide into the dash, then expand over the contours of the interior plastic and then lock into place. The head unit then slides into that for a secure fit. 

More wires. The entire HVAC control panel is removed now. Note the bare knobs and sliders on the bottom. 


Rory traded his food for a panel. 

Struggling to get things aligned again. 

Nice. Everything is back in place, except the clock...

Shoot. Installing the clock meant transferring a small plastic piece from the old control panel. We did not realize that until we had everything else sealed up. We ended up re-doing most of the above steps...

Powered up. 








7.09.2013

New bike

Finally got around to acquiring a bike. Took an old Schwinn frame and stripped it of a lot of unnecessary parts. 
Started with this. 

Wish I had a work stand. Some clamps will do. 

Front wheel in place. That was easy. 

Trying to remove the larger cog with tin snips. I would have to be just a bit stronger for that to work. 

Here is the problem: the outer cog is no longer wanted since I am making a single-speed bike. I have it loose, but it is still captive around the crank. Don't feel like removing the crank. 

One solution that I know will work...

Cut the cog with a pneumatic cutting tool! Problem solved!

The (mostly) finished product. Still needs some fine tuning. 






7.05.2012

Thesis so far

If anyone is bored, here's a link to what I've written for my thesis so far. I am still working on adding novel results. Let me know if you see any errors.

3.26.2012

Editorial column

I was cleaning out my closet, and I found a box of newspapers containing the editorials I wrote while I worked for my high school paper, The Smoky Hill Express. I haven't edited these at all, so excuse any errors you find. Text after the break.


2.22.2012

Is this Tumblr?

No? Whatever. Here are a couple of links.

Brainstorming is not the best model. Lots of people probably know this intuitively, but I appreciate the statistics. How many brainstorming meetings turn out to be totally useless? Related: "The Pope's visit to Britain will not be affected by the disclosure of a Foreign Office document mocking the Catholic Church, the Vatican said."

How to do what you love. The best part of the article (I shortened that to 'particle' the first time I tried to write it out) was the two models of attaining a job doing what you love: the organic route and the two-job route. Right now, I'm leaning more towards the two-job route. I would appreciate having a job of any sort right now more than having my dream job. At least for now, my day job would provide me a source of income to pursue my "true" passion, whatever that is. I know that it's not writing my thesis...